14.06.2009, 09:04
Here's an example:
https://sampwiki.blast.hk/wiki/SetTimerEx
pawn Код:
//top
new timername[MAX_PLAYERS];
//onplayercmdtext
if(strcmp(cmdtext, "/execute", true) == 0)
{
timername[playerid] = SetTimerEx("timerfunction", 50, false, "i", playerid);
}
if(strcmp(cmdtext, "/kill", true) == 0)
{
KillTimer(timername[playerid]);
}
//the function
forward timerfunction(playerid);
public timerfunction(playerid)
{
//do something
}