17.01.2016, 14:38
This should work.
EDIT: Fixed a typo, my bad.
PHP код:
public OnPlayerDisconnect(playerid, reason) {
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason) {
case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
}
for(new i,j=GetPlayerPoolSize();i<=j;i++) {
if(!IsPlayerConnected(i) || IsPlayerAdmin(i)) continue;
SendClientMessage(i, -1, string);
}
return 1;
}