PyarMeena

Block Cmd Script

Aug 27th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. /* Command Blocking Script */
  2. /* By */
  3. /* SuperHelper */
  4. /* Pls Dont remove credits */
  5.  
  6.  
  7. /* Includes */
  8. #include <a_samp>
  9. #include <streamer>
  10. #include <sscanf2>
  11. #include <dini>
  12. #include <zcmd>
  13.  
  14. #define FILTERSCRIPT
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. print("\n--------------------------------------");
  19. print(" Blank Filterscript by your name here");
  20. print("--------------------------------------\n");
  21. return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26. return 1;
  27. }
  28.  
  29. /* Colors */
  30. #define COLOR_DARKRED 0xAA3333FF
  31. #define RED 0xFF0000C8
  32. #define COLOR_GREY 0xAFAFAFFF
  33. #define COLOR_ASAY 0xFF0000FF
  34. #define COLOR_OSAY 0x007700FF
  35. #define COLOR_HSAY 0x1684CAFF
  36. #define COLOR_MSAY 0x1684CAFF
  37. #define COLOR_WHITE 0xFFFFFFFF
  38. #define COLOR_YELLOW 0xFFFF00FF
  39. #define COLOR_RED 0xFF0000FF
  40. #define COLOR_LRED 0xFF4747FF
  41. #define COLOR_GREEN 0x00FF00FF
  42. #define COLOR_BLUE 0x0000FFFF
  43. #define COLOR_LBLUE 0x99FFFFFF
  44. #define COLOR_LIGHTBLUE 0x99FFFFFF
  45. #define COLOR_ORANGE 0xFF9900FF
  46. #define COLOR_PURPLE 0xCC00DDFF
  47. #define COLOR_PEACH 0xFFCC66FF
  48. #define COLOR_SILVER 0xDDDDDDFF
  49. #define COLOR_WANTEDBLUE 0x0055CCFF
  50. #define COLOR_DARK_VIOLET 0x9400D3FF
  51. #define COLOR_VIP1 0x9400D3FF
  52. #define COLOR_HELP 0x00E5EEFF
  53. #define COLOR_ADMIN 0x0066FFFF
  54. #define COLOR_ADMIN2 0x008FD6FF
  55. #define COLOR_PLAYER 0xFFFF33FF
  56. #define COLOR_ULTRAADMIN 0x993300FF
  57. #define COLOR_EVENT 0x00CC66FF
  58. #define COLOR_VIP2 0xFF33CCFF
  59. #define COLOR_VIPCHAT 0xCC66CCFF
  60.  
  61.  
  62. CMD:blockcmd(playerid, params[])
  63. {
  64. new cmd[200];
  65. if(sscanf(params, "s[200]", cmd)) return SendClientMessage(playerid, -1, "USAGE: /blockcmd [Command]");
  66. if(cmd[0] == '/') strdel(cmd, 0, 1);
  67. if(dini_Isset("BlockedCmds/cmds.ini", cmd)) return SendClientMessage(playerid, COLOR_RED, "Error: Command Already Blocked!");
  68. dini_Set("BlockedCmds/cmds.ini", cmd, "Blocked");
  69. new string[256];
  70. format(string, sizeof(string), "%s has been blocked", cmd);
  71. SendClientMessage(playerid, COLOR_YELLOW, string);
  72. return 1;
  73. }
  74.  
  75. CMD:blockedcmds(playerid, params[])
  76. {
  77. new strings[128], File: file = fopen("BlockedCmds/cmds.ini", io_read), admins=1;
  78. SendClientMessage(playerid, COLOR_ORANGE, "[Blocked Commands Of This Server]:");
  79. while(fread(file, strings))
  80. {
  81. format(strings, sizeof(strings), "%d) %s", admins, strings);
  82. SendClientMessage(playerid, COLOR_ORANGE, strings);
  83. admins ++;
  84. }
  85. fclose(file);
  86. return 1;
  87. }
  88.  
  89. CMD:unblockcmd(playerid, params[])
  90. {
  91. new cmd[200];
  92. if(sscanf(params, "s[200]", cmd)) return SendClientMessage(playerid, -1, "USAGE: /unblockcmd [Command]");
  93. if(cmd[0] == '/') strdel(cmd, 0, 1);
  94. if(!dini_Isset("BlockedCmds/cmds.ini", cmd)) return SendClientMessage(playerid, COLOR_RED, "Error: Command isn't Blocked!");
  95. dini_Unset("BlockedCmds/cmds.ini", cmd);
  96. new string[256];
  97. format(string, sizeof(string), "%s has been unblocked", cmd);
  98. SendClientMessage(playerid, COLOR_YELLOW, string);
  99. return 1;
  100. }
Add Comment
Please, Sign In to add comment