Server freezing 'kicking ip because they didn't logon to the game'
#18

Don't overload OnPlayerConnect callback with many functions. Delay it for safe calls.
pawn Код:
new
    OPC_Timer[MAX_PLAYERS] = {-1, ...};
   
public OnPlayerConnect(playerid) {

    if(OPC_Timer[playerid] == -1)
        OPC_Timer[playerid] = SetTimerEx("SafeOnPlayerConnect", 300, false, "d", playerid);
    else {
   
        KillTimer(OPC_Timer[playerid]);
        OPC_Timer[playerid] = -1;
        OnPlayerConnect(playerid);
    }
    return 1;
}

forward SafeOnPlayerConnect(playerid);

public SafeOnPlayerConnect(playerid)
{
    OPC_Timer[playerid] = -1; //Resetting the variable.
   
    if(!IsPlayerConnected(playerid)) return 0; //If player has left before this getting called, stop going further then.
    //Rest onplayerconnect codes here.
   
    return 1;
}
Reply


Messages In This Thread
Server freezing 'Kicking ip because they didn't logon to the game' - by Guest4390857394857 - 14.09.2014, 12:14
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Ox1gEN - 14.09.2014, 12:23
Re: Server freezing 'kicking ip because they didn't logon to the game' - by SPA - 14.09.2014, 12:26
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Ox1gEN - 14.09.2014, 12:28
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Guest4390857394857 - 14.09.2014, 12:29
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Ox1gEN - 14.09.2014, 12:30
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Guest4390857394857 - 14.09.2014, 12:33
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Ox1gEN - 14.09.2014, 12:38
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Guest4390857394857 - 14.09.2014, 12:43
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Ox1gEN - 14.09.2014, 12:48
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Guest4390857394857 - 14.09.2014, 12:56
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Ox1gEN - 14.09.2014, 12:58
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Venice - 14.09.2014, 13:00
Re: Server freezing 'kicking ip because they didn't logon to the game' - by SPA - 14.09.2014, 13:10
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Venice - 14.09.2014, 13:11
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Guest4390857394857 - 14.09.2014, 13:14
Re: Server freezing 'kicking ip because they didn't logon to the game' - by SPA - 14.09.2014, 13:14
Re: Server freezing 'kicking ip because they didn't logon to the game' - by Lordzy - 14.09.2014, 14:33

Forum Jump:


Users browsing this thread: 1 Guest(s)