18.01.2019, 23:44
pTask or SetTimerEx...
Just
timer[playeird] = SetTimerEx bla bla on player connect.
then
Just
timer[playeird] = SetTimerEx bla bla on player connect.
then
PHP Code:
public OnPlayerDisconnect(playerid, reason)
{
for(new i=0; i < UsedTimers[playerid]; i++)
{
KillTimer(PTimer[playerid][i]);
// Are you lol?, if you put this on loop, it stops looping because variable i greater than -1.
//UsedTimers[playerid] = -1;
}
//place in here, because if the variable i is greater than your UsedTimers, then the script continue read this until return 1;
UsedTimers[playerid] = -1;
return 1;
}