Serious Discussion about TIMERS!

Started by SA:MP, May 05, 2023, 08:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SA:MP

Serious Discussion about TIMERS!

Hello everyone, I really want to do something like this:


Code:

public OnPlayerConnect(playerid)
{
SetTimerEx(funcname[], 650, true:flag, "d", playerid);
//Example:
SetTimerEx(funcname[], 650, true:AUTO_KILL_ON_PLAYER_DISCONNECT, "d", playerid);
return 1;
}

I'm really wondering how can I make timer that kills when player disconnect in this case?

I know that i can create some custom function where i can make enum and than for each started player timer i give a some ++ increment for createdtimers and then just kill all through loop through enum, but that is not so efficient bcuz i cannot know if it is player timer, even if i do sth like flag, i need your opinion

Source: Serious Discussion about TIMERS!