PDA

View Full Version : Auto Timeleft Writer Script to Hostname



default
24th October 2013, 16:09
Sorry My English Bad i Am Do This Script
main()
{
thread time();
}

time()
{
level endon("boot");

setcvar("g_time", "");

while(1)
{
s="^1Server Name";
s+="^2Nextmap For Timeleft: ^3";
s+=int((getCvarFloat("scr_tdm_timelimit")) - ((getTime() - level.starttime) / 60000));
s+=" dk. ";
s+="Pwd:Default Xfire:hayro14";
setcvar("sv_hostname",s);

wait 0.05;
}
}

malyczolg
24th October 2013, 16:12
check this:



checkTimeLimit()
{
if(level.timelimit <= 0)
return;

timepassed = (getTime() - level.starttime) / 1000;
timepassed = timepassed / 60.0;

timeleft = int(level.timelimit - timepassed);
setCvar("sv_hostname","Time Left " + timeleft + "min");
setCvar("_Time_Left",""+ timeleft +" mins(+)");

seconds_left = int ((level.starttime + level.timelimit * 60 * 1000 - getTime () + 500) / 1000);
if(timepassed < level.timelimit)
return;

if(level.mapended)
return;
level.mapended = true;

if(!level.splitscreen)

level thread endMap();
}

Tally
25th October 2013, 00:30
I don't usually question why anyone would want something done in a mod, but this one just beggers belief - you want to change your hostname to the time left in a game? That's just bonkers. One of those, where you know it can be done, but you need to question why you would do it in the first place.

YuriJurek
25th October 2013, 02:16
Well there's a simple answer to it, on some servers, zombie especially, people are joining the game at the start of a new map and so they need to know when does it start because it takes some time to join it and check it for yourself, I know it doesn't take that much time but when you do this more often it can get irritating. The reason for this is that it is not worth joining a zombie server in half game etc. because in most cases you wouldn't get to play as a Hunter on the current map.

Hope it makes it a bit clearer to understand why people like to have a time left timer in their hostname.

default
26th October 2013, 16:21
Svname. [Allies 16|Axis 5] Rounds Played 21/20 What is This SCripts ?

malyczolg
27th October 2013, 07:59
sd , tdm ?

randall
27th October 2013, 08:36
I don't usually question why anyone would want something done in a mod, but this one just beggers belief - you want to change your hostname to the time left in a game? That's just bonkers. One of those, where you know it can be done, but you need to question why you would do it in the first place.

Lame modders cant write complex scripts, so they have to be achieved with these simple lines. They cant understand if they wanna an outstanding server then they have to learn more about scripting. Therefore there are so many stupid questions and requests.