10.02.2010, 07:48
do a player loop and only send message if player is admin
-edit
ettans works too, lol at how many people post so fast.
oh, just noticed that you format the string for each admin? why not do it before the loop.
Code:
public OnPlayerDisconnect(playerid, reason) { new string[64], name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); switch(reason) { case 0: format(string,sizeof string,"%s left the server. (Timed out)",name); case 1: format(string,sizeof string,"%s left the server. (Leaving)",name); case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name); } for(new pid=0; pid<GetMaxPlayers(); pid++) { if(IsPlayerAdmin(pid)) SendClientMessage(pid, 0xFFFFFFAA,string); } return 1; }
ettans works too, lol at how many people post so fast.
oh, just noticed that you format the string for each admin? why not do it before the loop.