01.12.2014, 13:59
Ey guys. So I created a basic countdown and for some reason it glitches the last numbers are stayng allways.
I mean exemple countdow is 10 secconds
So it goes from 10 to 9 - 10stays then 9 stays then 8 and so on..
hares my script. I have no idea how to fix it..
Tryed so much ways none worked. Help? :X
I mean exemple countdow is 10 secconds
So it goes from 10 to 9 - 10stays then 9 stays then 8 and so on..
hares my script. I have no idea how to fix it..
Код:
new CountDownFromAmount; new PlayerText:dcd[MAX_PLAYERS]; new DeathTm[MAX_PLAYERS]; command(cds, playerid, params[]) { CountDownFromAmount = 10; DeathTm[playerid] = SetTimerEx(" CountDownTimer",1000,true,"i",playerid); return 1; } forward CountDownTimer(playerid); public CountDownTimer(playerid) { CountDownFromAmount--; new string[128]; format(string, 128, "%d", CountDownFromAmount); dcd[playerid] = CreatePlayerTextDraw(playerid, 100, 100, string); PlayerTextDrawShow(playerid, dcd[playerid]); PlayerTextDrawUseBox(playerid, dcd[playerid], 0); PlayerTextDrawSetOutline(playerid, dcd[playerid], 0); PlayerTextDrawSetShadow(playerid, dcd[playerid], 0); PlayerTextDrawSetProportional(playerid, dcd[playerid], 1); PlayerTextDrawSetOutline(playerid, dcd[playerid], 0); if (CountDownFromAmount == 0) { GameTextForAll("End of round!!", 3000, 5); } return 1; }