BulletRja

Dynamic BR Block Command System

Dec 28th, 2017
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.85 KB | None | 0 0
  1. /*
  2.   BBBBBBBBBBBBBBBBB           RRRRRRRRRRRRRR
  3.   BB              BB          RR           RR
  4.   BB             BB           RR          RR
  5.   BB            BB            RR         RR
  6.   BB           BB             RR        RR
  7.   BBBBBBBBBBBBB               RRRRRRRRRR
  8.   BB           BB             RR        RR
  9.   BB            BB            RR         RR
  10.   BB             BB           RR          RR
  11.   BB              BB          RR           RR
  12.   BBBBBBBBBBBBBBBBB           RR            RR
  13.   BULLET RAJA PRESENTS Dynamic BR Block Command System
  14. */
  15. #define FILTERSCRIPT
  16.  
  17. /* Includes */
  18. #include <a_samp>
  19. #include <sscanf2>
  20. #include <Dini>
  21. #include <zcmd>
  22.  
  23. #define COLOR_YELLOW 0xFFFF00FF
  24.  
  25. public OnFilterScriptInit()
  26. {
  27.     print("\n============================================");
  28.     print("Dynamic BR Block Command System By BulletRaja");
  29.     print("============================================\n");
  30.    
  31.     print("Dynamic BR Block Command System Loaded");
  32.     return 1;
  33. }
  34.  
  35. public OnFilterScriptExit()
  36. {
  37.     return 1;
  38. }
  39.  
  40. public OnPlayerCommandReceived(playerid, cmdtext[])
  41. {
  42.     if(cmdtext[0] == '/') strdel(cmdtext, 0, 1);
  43.     if(strfind(cmdtext, " ") != -1)
  44.     {
  45.         strdel(cmdtext, strfind(cmdtext, " "), strlen(cmdtext));
  46.     }
  47.     if(dini_Isset("Commands/cmds.ini", cmdtext))
  48.     {
  49.      SendClientMessage(playerid, COLOR_YELLOW, "[BR BLOCK] Unknown Command.");
  50.      return 0;
  51.     }
  52.     return 1;
  53. }
  54.  
  55. CMD:blockcmd(playerid, params[])
  56. {
  57.  new cmd[200];
  58.  if(sscanf(params, "s[200]", cmd)) return SendClientMessage(playerid, -1, "USAGE: /blockcmd [Command]");
  59.  if(cmd[0] == '/') strdel(cmd, 0, 1);
  60.  if(dini_Isset("Commands/cmds.ini", cmd)) return SendClientMessage(playerid, COLOR_YELLOW, "Error: Command Already Blocked!");
  61.  dini_Set("Commands/cmds.ini", cmd, "Blocked");
  62.  new string[256];
  63.  format(string, sizeof(string), "%s has been blocked", cmd);
  64.  SendClientMessage(playerid, COLOR_YELLOW, string);
  65.  return 1;
  66. }
  67.  
  68. CMD:unblockcmd(playerid, params[])
  69. {
  70.  new cmd[200];
  71.  if(sscanf(params, "s[200]", cmd)) return SendClientMessage(playerid, -1, "USAGE: /unblockcmd [Command]");
  72.  if(cmd[0] == '/') strdel(cmd, 0, 1);
  73.  if(!dini_Isset("Commands/cmds.ini", cmd)) return SendClientMessage(playerid, COLOR_YELLOW, "Error: Command isn't Blocked!");
  74.  dini_Unset("Commands/cmds.ini", cmd);
  75.  new string[256];
  76.  format(string, sizeof(string), "%s has been unblocked", cmd);
  77.  SendClientMessage(playerid, COLOR_YELLOW, string);
  78.  return 1;
  79. }
  80.  
  81. CMD:blockedcmds(playerid, params[])
  82. {
  83.     new strings[128], File: file = fopen("BlockedCmds/cmds.ini", io_read), blockedcmds=1;
  84.     SendClientMessage(playerid, COLOR_YELLOW, "[Blocked Commands Of This Server]:");
  85.     while(fread(file, strings))
  86.     {
  87.         format(strings, sizeof(strings), "%d) %s", blockedcmds, strings);
  88.         SendClientMessage(playerid, COLOR_YELLOW, strings);
  89.         blockedcmds ++;
  90.     }
  91.     fclose(file);
  92.     return 1;
  93. }
Add Comment
Please, Sign In to add comment