Advertisement
Guest User

Edited No Guns Script

a guest
Oct 25th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. #include <a_samp>
  2. #include <ZCMD>
  3. #include <sscanf>
  4.  
  5. #define MAX_WARNS 4
  6.  
  7. new Noguns[MAX_PLAYERS];
  8. new Warning[MAX_PLAYERS];
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n-------D A R [ K ] L O R D ------------");
  13. print("Noguns Script Loaded!");
  14. print("Author : -=Dar[K]Lord=-");
  15. print("-----------------------------------------");
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. return 1;
  22. }
  23.  
  24. CMD:noguns(playerid,params[])
  25. {
  26. if(IsPlayerAdmin(playerid))
  27. {
  28. for(new i = 0; i < MAX_PLAYERS; i++)
  29. if(Noguns[i] == 0)
  30. {
  31. new string[120];
  32. format(string,sizeof(string),"[AMX_RCON]:{FF0000}Guns Disabled");
  33. SendClientMessage(i,0xFFFFFFFF,string);
  34. Noguns[i] = 1;
  35. }
  36. else if(Noguns[i] == 1)
  37. {
  38. new string[120];
  39. format(string,sizeof(string),"[AMX_RCON]:{FF0000}Guns Enabled");
  40. SendClientMessage(i,0xFFFFFFFF,string);
  41. Noguns[i] = 0;
  42. }
  43. }
  44. else
  45. {
  46. if(Warning[playerid] < MAX_WARNS)
  47. {
  48. Warning[playerid]++;
  49. new string[200];
  50. format(string,sizeof(string),"[AMX_RCON]:{FF0000}You Have No Authorization to this command! | Warning: %d/%d",Warning[playerid],MAX_WARNS);
  51. SendClientMessage(playerid,0xFFFFFFFF,string);
  52. PlayerPlaySound(playerid,1057,0,0,0);
  53. }
  54. if(Warning[playerid] == MAX_WARNS)
  55. {
  56. Warning[playerid] = 0;
  57. new string[200];
  58. format(string,sizeof(string),"[AMX_RCON]:{FF0000}You Have No Authorization to this command! | Warning: %d/%d | KICKED!",Warning[playerid],MAX_WARNS);
  59. SendClientMessageToAll(0xFFFFFFFF,string);
  60. format(string,sizeof(string),"[AMX_RCON]:{FF0000}Player %s(ID:%s) Has Been Kicked For Trying Rcon commands!",Playername(playerid),playerid);
  61. SendClientMessageToAll(0xFFFFFFFF,string);
  62. PlayerPlaySound(playerid,1190,0,0,0);
  63. Kick(playerid);
  64. }
  65. }
  66. return 1;
  67. }
  68. public OnPlayerUpdate(playerid)
  69. {
  70. for(new i = 0; i < MAX_PLAYERS; i++)
  71. if(Noguns[i] == 1)
  72. {
  73. if(!IsPlayerAdmin(playerid))
  74. {
  75. if(GetPlayerWeapon(playerid) > 0 || GetPlayerWeapon(playerid) <= 47)
  76. {
  77. ResetPlayerWeapons(playerid);
  78. }
  79. }
  80. else
  81. {
  82. return 1;
  83. }
  84. }
  85. return 1;
  86. }
  87. stock Playername(playerid)
  88. {
  89. new PName[24];
  90. GetPlayerName(playerid,PName,24);
  91. return PName;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement