01.01.2014, 17:34
I just set a repeat timer OnPlayerDeath
The whole function:
Seems correct,doesn't it?
You see the print. There are 2836553 lines like that... But the stop code is just under the print line... so what's wrong?
pawn Код:
AfterDeathTimer[playerid] = repeat AfterDeathFunction(playerid);
The whole function:
pawn Код:
timer AfterDeathFunction[1000](playerid)
{
new str[32];
CountTime[playerid]--;
format(str,sizeof(str),"Pasveiksite po %s",ConvertSecondsString(CountTime[playerid]));
TextDrawSetString(HospitalDelay[playerid],str);
TextDrawHideForPlayer(playerid,HospitalDelay[playerid]);
TextDrawShowForPlayer(playerid,HospitalDelay[playerid]);
if(CountTime[playerid] <= 0)
{
printf("AfterDeathTimer still running with CountTime:%d",CountTime[playerid]);
stop AfterDeathTimer[playerid];
TextDrawHideForPlayer(playerid,HospitalDelay[playerid]);
SendClientMessage(playerid,GREEN,"Jūs jau visiљkai sveikas, galite iљeiti iљ ligoninės!");
SetPlayerHealth(playerid,100.0);
set.IsAfterDeath[playerid] = false;
}
return 1;
}
pawn Код:
[22:35:12] AfterDeathTimer still running with CountTime:-2836553[22:35:12] AfterDeathTimer still running with CountTime:-2836553