22.02.2014, 14:30
Also don't forget to set a variable to the timer for properly using KillTimer
For example
For example
PHP код:
new ptimer; // ptimer like pos timer
public UpdatePlayerPos(playerid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
// Don't know what you wanna do, so i'll use it with SetPlayerCheckpoint
for(new p = 0; p < MAX_PLAYERS;p++)
{
if(p == playerid) continue;
else return SetPlayerCheckpoint(i, x, y, z, 5.0);
}
// In ur command
ptimer = SetTimerEx("UpdatePlayerPos", 500, true, "d", playerid);
// In the command to stop
if(strcmp(cmdtext, "/stoptimer", true) == 0)
{
KillTimer(ptimer);
print("Timer killed");
return 1;
}