How to create a new function
#4

You are probably speaking about a callback which is called like a OnPlayerConnect callback but delayed, right? You can do something such as:
pawn Код:
new PlayerConnectTimer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
       PlayerConnectTimer[playerid] = SetTimerEx("DelayedConnect", 5000, false, "i", playerid);
       return 1;
}

public OnPlayerDisconnect(playerid, reason) return KillTimer(PlayerConnectTimer[playerid]);

forward DelayedConnect(playerid);
public DelayedConnect(playerid)
{
     PlayerConnectTimer[playerid] = 0;
     return 1;
}
Reply


Messages In This Thread
How to create a new function - by saffierr - 23.08.2015, 21:48
AW: How to create a new function - by MrGtasagamer - 23.08.2015, 21:55
AW: How to create a new function - by Kaliber - 23.08.2015, 21:55
Re: How to create a new function - by Abagail - 23.08.2015, 22:00
Re: How to create a new function - by rymax99 - 23.08.2015, 22:00
Re: How to create a new function - by saffierr - 23.08.2015, 22:02
Re: How to create a new function - by saffierr - 23.08.2015, 22:08
AW: Re: How to create a new function - by MrGtasagamer - 23.08.2015, 22:12
Re: How to create a new function - by saffierr - 23.08.2015, 22:20
Re: How to create a new function - by Abagail - 23.08.2015, 22:22

Forum Jump:


Users browsing this thread: 2 Guest(s)