27.02.2019, 17:40
Tenta ae
PHP код:
#define LIMIT_PLAYER 80
new TimerConnect[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
TimerClearTela[playerid] = SetTimerEx("ClearChatLogin", 2000, true, "i", playerid);
if(gPlayerLogged[playerid] == 0 && NaoPodeLogar[playerid] == 0){
TimerConnect[playerid] = SetTimerEx("Connecting", 3000, 1, "i", playerid);
}
return 1;
}
BPC:Connecting(playerid){
new File[50];
format(File, sizeof(File), "Contas/%s.ini", pName[playerid]);
for(new i = 0; i < 90; i++){
if(i == LIMIT_PLAYER){
if(DOF2::FileExists(File))
if(DOF2::GetInt(File, "Admin") != 0){
showDialogLogin(playerid);
KillTimer(TimerConnect[playerid]);
return 1;
}
SendClientMessage(playerid, 0xA9C4E4FF, "Connecting to 144.217.0.35:7777...");
SendClientMessage(playerid, 0xA9C4E4FF, "The server is full. Retrying...");
return 1;
}else{
if(DOF2::FileExists(File)){
showDialogLogin(playerid);
KillTimer(TimerConnect[playerid]);
}else{
showDialogRegister(playerid);
KillTimer(TimerConnect[playerid]);
}
}
}
return 1;
}