SA-MP Forums Archive
kill timer for player? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: kill timer for player? (/showthread.php?tid=213986)



kill timer for player? - WardenCS - 20.01.2011

how can i kill this timer for player
Код:
Inftimer = SetTimerEx("InfectedTimer",5000,true,"i",i);
i dont get it
i made cmd
Код:
if(strcmp(cmdtext, "/auninfected",true) == 0)
{
if (PlayerStatistics[playerid][pAdminLevel] >= 1)
{
Infected[playerid] = 0;
KillTimer(Inftimer);
SetPlayerDrunkLevel(playerid,0);
}
return 1;
}
but it wont kill timer for ME


Re: kill timer for player? - iggy1 - 20.01.2011

You need to use an array like this,
pawn Код:
new Inftimer[MAX_PLAYERS];

Inftimer[playerid] = SetTimerEx("InfectedTimer",5000,true,"i",playerid);

KillTimer(Inftimer[playerid]);



Re: kill timer for player? - WardenCS - 20.01.2011

Код:
C:\Users\maff\Desktop\klaus\werp\0.3c\gamemodes\werp.pwn(5756) : error 028: invalid subscript (not an array or too many subscripts): "Inftimer"
C:\Users\maff\Desktop\klaus\werp\0.3c\gamemodes\werp.pwn(5756) : warning 215: expression has no effect
C:\Users\maff\Desktop\klaus\werp\0.3c\gamemodes\werp.pwn(5756) : error 001: expected token: ";", but found "]"
C:\Users\maff\Desktop\klaus\werp\0.3c\gamemodes\werp.pwn(5756) : error 029: invalid expression, assumed zero
C:\Users\maff\Desktop\klaus\werp\0.3c\gamemodes\werp.pwn(5756) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: kill timer for player? - iggy1 - 20.01.2011

Show the block of code where the errors are (not just the error lines). Prefferably where you set the timer. (you might not be able to pass playerid as a param)


Re: kill timer for player? - WardenCS - 20.01.2011

5765 KillTimer(Inftimer[playerid]);


Re: kill timer for player? - WardenCS - 20.01.2011

upup