All pastes #832628 Raw Edit

Something

public text v1 · immutable
#832628 ·published 2007-12-26 12:32 UTC
rendered paste body
public 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++) if(IsPlayerConnected(i) && i != playerid) SendClientMessage(i,grey,string);
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && Spec[i][SpectateID] == playerid  && Spec[i][Spectating]) { TogglePlayerSpectating(i,false); Spec[i][Spectating] = false, Spec[i][SpectateID] = INVALID_PLAYER_ID; }
	return 1;
}
dcmd_logout(playerid);
	return 1;
}