Results 1 to 10 of 19

Thread: date and time script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You need to learn your way around this: https://killtube.org/showthread.php?...out-precaching
    timescale 0.01

  2. The Following User Says Thank You to kung foo man For This Useful Post:

    kubislav23 (14th June 2018)

  3. #2
    Private
    Join Date
    Dec 2016
    Posts
    30
    Thanks
    5
    Thanked 5 Times in 5 Posts
    see my simple script...

    PHP Code:
    init() 
    {
        
    thread ShowTime();
    }

    ShowTime() 
    {
        
    self endon("disconnect");
        
    wait level.fps_multiplier 1;
        
        
    time newHudElem();
        
    time.70;
        
    time.460;
        
    time.alignX "left";
        
    time.alignY "top";
        
    time.fontScale 0.8;
        
    time.color = (100);
        
    time setText(game["showtime"]);

    i wish the game["showtime"] were the date.

    but ... when you say to inform getlocaltime() everything goes blank... hud does not appear.
    Last edited by caldas; 14th June 2018 at 03:21.

  4. #3
    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.

  5. 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
  •