Timer help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Timer help (
/showthread.php?tid=418375)
Timer help -
Colossus874 - 24.02.2013
I was playing around making a death system but why isn't this working at all?
Код:
public DeathTimer(playerid)
{
if(PlayerInfo[playerid][pDead] == 1)
{
if(PlayerInfo[playerid][pDeadTimer] == 0)
{
SpawnPlayer(playerid);
PlayerInfo[playerid][pDead] = 0;
}
else
{
PlayerInfo[playerid][pDeadTimer]--;
new string[128];
format(string,sizeof(string),"You have %d seconds left", PlayerInfo[playerid][pDeadTimer]);
SendClientMessage(i, COLOR_WHITE, string);
}
}
SetTimer("DeathTimer", 1000, true);
}
Re: Timer help -
DaRk_RaiN - 24.02.2013
Should use SetTimerEx
Replace this
pawn Код:
SetTimer("DeathTimer", 1000, true);
With this:
pawn Код:
SetTimerEx("DeathTimer",1000,1,"i",playerid);
Re: Timer help -
Colossus874 - 24.02.2013
I added it but it doesn't still say anything.