kill timer for player?
#1

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
Reply
#2

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

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

KillTimer(Inftimer[playerid]);
Reply
#3

Код:
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.
Reply
#4

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)
Reply
#5

5765 KillTimer(Inftimer[playerid]);
Reply
#6

upup
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)