11.06.2017, 22:37
I want the timer to be killed first and then set a new timer
PS: It is used for teleport messages.
PS: It is used for teleport messages.
Код:
stock SendBoxMsg(string[]) { if(CurrentMsg == 0) { TextDrawShowForAll(box0); TextDrawSetString(box0,string); KillTimer(box0tdtimer); box0tdtimer = SetTimer("box0td", 10000, true); CurrentMsg++; } else if(CurrentMsg == 1) { TextDrawShowForAll(box1); TextDrawSetString(box1,string); KillTimer(box1tdtimer); box1tdtimer = SetTimer("box1td", 10000, true); CurrentMsg++; } else if(CurrentMsg == 2) { TextDrawShowForAll(box2); TextDrawSetString(box2,string); KillTimer(box2tdtimer); box2tdtimer = SetTimer("box2td", 10000, true); CurrentMsg = 0; } else if(CurrentMsg >= 3) { CurrentMsg = 0; } }
Код:
forward box0td(playerid); public box0td(playerid) { TextDrawHideForAll(box0); CurrentMsg = 0; } forward box1td(playerid); public box1td(playerid) { TextDrawHideForAll(box1); CurrentMsg = 0; } forward box2td(playerid); public box2td(playerid) { TextDrawHideForAll(box2); }