Join/Quit Messages FAST
#3

do a player loop and only send message if player is admin

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;
}
-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.
Reply


Messages In This Thread
Join/Quit Messages FAST - by Seppo1997 - 10.02.2010, 07:43
Re: Join/Quit Messages FAST - by ettans - 10.02.2010, 07:47
Re: Join/Quit Messages FAST - by mansonh - 10.02.2010, 07:48
Re: Join/Quit Messages FAST - by Seppo1997 - 10.02.2010, 08:24
Re: Join/Quit Messages FAST - by ettans - 10.02.2010, 08:33
Re: Join/Quit Messages FAST - by mansonh - 10.02.2010, 08:40
Re: Join/Quit Messages FAST - by Seppo1997 - 10.02.2010, 10:14

Forum Jump:


Users browsing this thread: 3 Guest(s)