Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.41 KB | None | 0 0
  1. public OnPlayerDisconnect(playerid, reason)
  2. {
  3.     new string[128];
  4.     if(GetPVarInt(playerid, "Logged") == 1)
  5.     {
  6.         switch(reason)
  7.         {
  8.             case 0:
  9.             {
  10.                 format(string,sizeof string,"[Join/Quit] %s left the server. (Timed out)",GetPlayerNameEx(playerid));
  11.                 SendClientMessageToAll(color_grey, string);
  12.             }
  13.             case 1:
  14.             {
  15.                 format(string,sizeof string,"[Join/Quit] %s left the server. (Leaving)",GetPlayerNameEx(playerid));
  16.                 SendClientMessageToAll(color_grey, string);
  17.             }
  18.             case 2:
  19.             {
  20.                 format(string,sizeof string,"[Join/Quit] %s left the server. (Kicked/Banned)",GetPlayerNameEx(playerid));
  21.                 SendClientMessageToAll(color_grey, string);
  22.             }
  23.         }
  24.         printf("[Join/Quit] %s has left the server.", GetPlayerNameEx(playerid));
  25.         SetPVarInt(playerid, "Player:Logged", 0);
  26.         KillTimer(Level[playerid]);
  27.         KillTimer(JailTime);
  28.         SetPVarInt(playerid, "AdminLevel", 0);
  29.         SetPVarInt(playerid, "pMinutes", 0);
  30.         KillTimer(InjuriedTime);
  31.         KillTimer(DeadTime);
  32.         DeletePVar(playerid, "Injuried");
  33.         DeletePVar(playerid, "Dead");
  34.         Delete3DTextLabel(label[playerid]);
  35.         KillTimer(Level[playerid]);
  36.         KillTimer(AJailTimer[playerid]);
  37.         KillTimer(OnlineTimer[playerid]);
  38.         SetPVarInt(playerid, "Online15Minutes", 0);
  39.  
  40.         SaveStats(playerid);
  41.         SetPVarInt(playerid, "user_id", 0);
  42.     }
  43.     return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement