Results 1 to 8 of 8

Thread: [Tutorial] Time Left Script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by Earliboy View Post
    Code:
    TimeLeft()
    {
        servername = getCvar("sv_hostname");
    
        while(1)
        {
    	timeleft = level.timelimit - int((gettime() - level.starttime) / 60000 + 0.5);
    	setcvar("sv_hostname", servername + " || Time left: " + timeleft + " mins");
    	wait 10;
        }
    }
    This would be a littlebit easier, cause you can still set the servername via cfg file.
    Would not. Would fuck up the name at map_rotate, as it would say "IzNoGoD's awesome server Time left: 0 mins Time left: 30 mins", as you get the new sv_hostname from the var you just wrote the time_left to.

    Use a second cvar to store the original name plox.

  2. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (23rd January 2013)

Posting Permissions

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