19.04.2015, 04:44
Kick function used under OnPlayerConnect has got some issue. I doubt it's because Kick function is called before server accepting the client completely. All you've to do is to delay the kick or the best thing is to use delayed OnPlayerConnect.
pawn Код:
new
g_PlayerOPCTimer[MAX_PLAYERS] = {-1, ...};
public OnPlayerConnect(playerid) {
if(g_PlayerOPCTimer[playerid] == -1)
g_PlayerOPCTimer[playerid] = SetTimerEx("SafeOnPlayerConnect", 300, false, "i", playerid);
return 1;
}
forward SafeOnPlayerConnect(playerid);
public SafeOnPlayerConnect(playerid) {
g_PlayerOPCTimer[playerid] = -1;
if(!IsPlayerConnected(playerid)) return 1; //It has got a 300ms delay, it's possible to loose connection in that delay.
//codes
return 1;
}