16.07.2011, 14:04
Thats not the problem.
you forgot alot of obvious things.
Credits to Jeffry for making the script.
And freshorange for the post, i just added some things to make it work.
you forgot alot of obvious things.
pawn Код:
//top
forward UpdateTime();
new Time, TimeM, TimeS;
new Text:Timer;
//Under OnGameModeInit
Timer = TextDrawCreate(550.000000, 30.000000, "5:00");
TextDrawFont(Timer, 3);
TextDrawLetterSize(Timer, 0.600000, 1.100000);
TextDrawSetOutline(Timer, 1);
TextDrawSetShadow(Timer, 0);
TimeM = 5;
TimeS = 0;
Time = SetTimer("UpdateTime", 1000, true);
public UpdateTime()
{
new Str[34];
TimeS --;
if(TimeM == 0 && TimeS == 0)
{
KillTimer(Time);
SendRconCommand("gmx"); // restart server
//perform other functions
}
if(TimeS == -1)
{
TimeM--;
TimeS = 59;
}
format(Str, sizeof(Str), "%02d:%02d", TimeM, TimeS);
TextDrawSetString(Timer, Str);
return 1;
}
pawn Код:
TextDrawShowForPlayer(playerid,Timer);
//Add this under onplayerspawn
And freshorange for the post, i just added some things to make it work.