Results 1 to 10 of 19

Thread: date and time script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Feb 2018
    Posts
    28
    Thanks
    12
    Thanked 17 Times in 16 Posts
    https://killtube.org/showthread.php?...ocalizedString

    Quote Originally Posted by voron00 View Post
    Alright, if you use libcod you can use use new makelocalizedstring function:
    PHP Code:
    // Find free localized string index
    index findFreeConfigStringIndex(1310256);

    // Set configstring
    setConfigString(indexlevel.mapcandidate[0]["mapname"]);

    // Your Hud Stuff
    level.votemap0 setText(makeLocalizedString(level.mapcandidate[0]["mapname"]));

    findFreeConfigStringIndex(startend)
    {
        for (
    start 1start endi++)
        {
            
    configstring getConfigString(i);
            if (!
    isDefined(configstring))
                return 
    i;
        }

        return 
    undefined;

    Just tested it, works quite nicely.
    edit:
    This works
    Click image for larger version. 

Name:	time.png 
Views:	53 
Size:	24.3 KB 
ID:	1533
    PHP Code:
    init() 
    {
        
    thread ShowTime();
    }

    ShowTime() 
    {
        
    self endon("disconnect");
        
    wait level.fps_multiplier 1;
        
        
    localtime getlocaltime();
        
    index findFreeConfigStringIndex(1310256);
        
    setConfigString(indexlocaltime);
        
    time newHudElem();
        
    time.70;
        
    time.460;
        
    time.alignX "left";
        
    time.alignY "top";
        
    time.fontScale 0.8;
        
    time.color = (100);
        
    time setText(makeLocalizedString(localtime)); 
    }
    findFreeConfigStringIndex(startend)
    {
        for (
    start 1start endi++)
        {
            
    configstring getConfigString(i);
            if (!
    isDefined(configstring))
                return 
    i;
        }

        return 
    undefined;

    Last edited by buLLeT_; 14th June 2018 at 17:07.

  2. The Following 2 Users Say Thank You to buLLeT_ For This Useful Post:

    caldas (14th June 2018),kung foo man (14th June 2018)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •