07.03.2019, 18:58
Hey!
I'm having weird timer bug.. I'm displaying countdown of 3 2 1 GO! with gametext etc..
Lets say all of them get displayed normally but for some reason there is 1 second gap between each number is shown.. so lets say it goes
3 (waits one second) 2 (waits one second) 1 (waits one second) GO!
And I dont want that.. I want it to go 3 2 1 GO without that one second gap.. but I cant seem to find issue in my code.. I'll post it here
EDIT: Here's GIF of how it goes.. As you can see there's 1 second gap between
https://gyazo.com/77b789188c91a1813c2c19cd9951a639
I'm having weird timer bug.. I'm displaying countdown of 3 2 1 GO! with gametext etc..
Lets say all of them get displayed normally but for some reason there is 1 second gap between each number is shown.. so lets say it goes
3 (waits one second) 2 (waits one second) 1 (waits one second) GO!
And I dont want that.. I want it to go 3 2 1 GO without that one second gap.. but I cant seem to find issue in my code.. I'll post it here
PHP код:
Start_Map[DM] = SetTimerEx("StartMap", 1000, 1, "d", DM);
PHP код:
forward StartMap(mode);
public StartMap(mode)
{
new string[128];
switch(mode)
{
case DM:
{
Countdown[DM]--;
for(new j = GetPlayerPoolSize(), i = 0; i <= j; i++) if(IsPlayerConnected(i))
{
if(pMode[i] == DM)
{
if(Countdown[DM] > 0 )
{
format(string, sizeof(string), "%d", Countdown[DM]);
GameTextForPlayer(i, string, 1000, 4);
}
else
{
GameTextForPlayer(i, "Go!", 1000, 4);
KillTimer(Vehicle_Freeze[DM]);
KillTimer(Start_Map[DM]);
Countdown[DM] = 4;
TogglePlayerControllable(i, true);
}
}
}
}
}
return 1;
}
https://gyazo.com/77b789188c91a1813c2c19cd9951a639