BulletRja

BR Bug Report System

Dec 25th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.23 KB | None | 0 0
  1. /*
  2.   //////////////////////     ///////////////////
  3.   //                  //     //               //
  4.   //                  //     //               //
  5.   //                  //     //               //
  6.   //                  //     //               //
  7.   //                  //     //         //////
  8.   /////////////////////      ////////////
  9.   //                  //     //         //
  10.   //                  //     //          //
  11.   //                  //     //           //
  12.   //                  //     //            //
  13.   //                  //     //             //
  14.   /////////////////////      //              //
  15.   BULLET RAJA PRESENTS BUG REPORT SYSTEM
  16. */
  17. #define FILTERSCRIPT
  18.  
  19. /******  INCLUDES  *****/
  20. #include <a_samp>
  21. #include <sscanf2>
  22. #include <zcmd>
  23. #include <dini>
  24.  
  25. #define COLOR_YELLOW 0xFFFF00FF
  26.  
  27. public OnFilterScriptInit()
  28. {
  29.     print("\n--------------------------------------");
  30.     print(" Bug Report System By BulletRaja");
  31.     print("--------------------------------------\n");
  32.     return 1;
  33. }
  34.  
  35. public OnFilterScriptExit()
  36. {
  37.     return 1;
  38. }
  39.  
  40. CMD:reportbug(playerid, params[])
  41. {
  42.     new sstring[256], reason[128], playername[25], str[256];
  43.     if (sscanf(params, "s[128]", reason)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /reportbug [bug]");
  44.     GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  45.     format(str, sizeof(str), "You Have Reported: %s", reason);
  46.     SendClientMessage(playerid, COLOR_YELLOW, str);
  47.     format(sstring, sizeof(sstring), "%s has reported  bug - %s.\r\n", playername, reason);
  48.     format(str, sizeof(str), "Bug Log: %s has reported bug - %s.", playername, reason);
  49.     SendClientMessageToAll(COLOR_YELLOW, str);
  50.     printf("[ReportBug] %s has reported bug - %s.", playername, reason);
  51.     new File: file = fopen("bugreport.cfg", io_append);
  52.     fwrite(file, sstring);
  53.     fclose(file);
  54.     return 1;
  55. }
  56. CMD:checkbugs(playerid, params[])
  57. {
  58.     if(IsPlayerAdmin(playerid)) return 0;
  59.     new strings[128], File: file = fopen("bugreport.cfg", io_read), idxx=1;
  60.     SendClientMessage(playerid, COLOR_YELLOW, "[BugReports]:");
  61.     while(fread(file, strings))
  62.     {
  63.         format(strings, sizeof(strings), "%d) %s", idxx, strings);
  64.         SendClientMessage(playerid, COLOR_YELLOW, strings);
  65.         idxx ++;
  66.     }
  67.     fclose(file);
  68.     return 1;
  69. }
Add Comment
Please, Sign In to add comment