SA-MP Forums Archive
How to detect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to detect (/showthread.php?tid=129813)



How to detect - Torran - 23.02.2010

Im making a leaving server message,
How would i get it to detect if the player left due to

[b]Leaving, Crashed or Kicked/Banned?


Re: How to detect - Miguel - 23.02.2010

pawn Код:
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);
  }
  SendClientMessageToAll(0xAAAAAAAA, string);
  return 1;
}
Use Wiki...