Advertisement
Guest User

Grab Warning System

a guest
Nov 26th, 2012
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.59 KB | None | 0 0
  1.  
  2. #include <a_samp>
  3. #include <sscanf2>
  4. #include <zcmd>
  5.  
  6. #if defined FILTERSCRIPT
  7.  
  8. public OnFilterScriptInit()
  9. {
  10.     print("\n--------------------------------------");
  11.     print("Grab Warning System By GoldZoro-GrabCnR");
  12.     print("Grab IP: 62.141.35.14:7807");
  13.     print("--------------------------------------\n");
  14.     return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19.     return 1;
  20. }
  21.  
  22. #else
  23.  
  24. main()
  25. {
  26.     print("\n----------------------------------");
  27.     print("Grab Warning System By GoldZoro-GrabCnR");
  28.     print("Grab IP: 62.141.35.14:7807");
  29.     print("----------------------------------\n");
  30. }
  31.  
  32. #endif
  33.  
  34. #define ROJO 0xFF0000FF
  35. #define AC 0xFF1493FF
  36. #define COLOR_RED 0xFF0000AA
  37. #define BLANCO 0xFFFFFFFF
  38.  
  39. new WarnTimes[MAX_PLAYERS];
  40.  
  41. public OnPlayerDisconnect(playerid, reason)
  42. {
  43.     WarnTimes[playerid]=0;
  44.     return 1;
  45. }
  46.  
  47. command(warn, playerid, params[])
  48. {
  49.     if(IsPlayerAdmin(playerid))
  50.     {
  51.         new i, reason[50];
  52.         new name[50];
  53.         new string[100];
  54.         if(sscanf(params, "us[50]", i, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /warn [id] [reason]");
  55.         else if(i == INVALID_PLAYER_ID) SendClientMessage(playerid, ROJO, "Player is not connected!");
  56.         else
  57.         {
  58.             GetPlayerName(i, name, sizeof(name));
  59.             if(playerid!=i)
  60.             {
  61.                 if(WarnTimes[i]>=2)
  62.                 {
  63.                     format(string, 100,"[AUTO-KICK]: %s[%d] Has Been Kicked From The Server, [3/3 Warnings]", name, i);
  64.                     SendClientMessageToAll(AC, string);
  65.                     SetPlayerHealth(i, 999999999);
  66.                     SetPlayerInterior(i, 10);
  67.                     SetPlayerPos(i,226.9807,111.1730,999.0156);
  68.                     format(string, sizeof(string), "~W~You Have Been ~R~Kicked ~W~From The Server");
  69.                     GameTextForPlayer(i ,string, 99999999999999999999999, 3);
  70.                     Kick(i);
  71.                 }
  72.                 else
  73.                 {
  74.                     WarnTimes[i]+=1;
  75.                     if(WarnTimes[i]==1)
  76.                     {
  77.                         format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [1/3 Warnings]", reason);
  78.                         SendClientMessage(i, AC, string);
  79.                     }
  80.                     else if(WarnTimes[i]==2)
  81.                     {
  82.                         format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [2/3 Warnings]", reason);
  83.                         SendClientMessage(i, AC, string);
  84.                     }
  85.                     format(string, 256,"[ADMIN-WARN]: %s[%d] Has Received A Warning, Reason: %s", name, i, reason);
  86.                     SendClientMessageToAll(AC, string);
  87.                     GameTextForPlayer(i,"~W~You Have Received A ~n~  ~R~Warning",5000,3);
  88.                 }
  89.             }
  90.             else SendClientMessage(playerid, COLOR_RED, "You Can't Warn Your Self");
  91.         }
  92.     }
  93.     else SendClientMessage(playerid, COLOR_RED, "[Command Not Found Use /cmds or /commands.!]");
  94.     return 1;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement