rendered paste bodypublic OnPlayerDisconnect(playerid,reason)
{
new Reason[256], string[256],name[24]; GetPlayerName(playerid,name,24);
switch(reason) { case 0: Reason = "Timed Out"; case 1: Reason = "Leaving"; case 2: Reason = "Kick/Ban"; }
format(string,256,"*** %s has left the server. (%s)",name,Reason);
for(new i = 0;i < MAX_PLAYERS;i++)
{
Reports[playerid][i] = 0;
Reports[i][playerid] = 0;
}
ReadConfig();
printf(" |--quit > %s",Name[playerid]);
Level[playerid] = 0;
SetLevel(playerid,0);
Name[playerid] = "";
OnlinePlayers[playerid] = 0;
num_online_players--;
if(num_online_players == 0) { // Disable Player Lock
player_lock = 0;
}
}
/* small test
public OnPlayerRequestSpawn(playerid)
{
if(Level[playerid] == 0)
{
SendClientMessage(playerid, COLOR_ORANGE, "Requesting spawn aye?");
return 0;
}
SendClientMessage(playerid, COLOR_YELLOW, "Great!");
return 1;
}*/