Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ////////////////////// ///////////////////
- // // // //
- // // // //
- // // // //
- // // // //
- // // // //////
- ///////////////////// ////////////
- // // // //
- // // // //
- // // // //
- // // // //
- // // // //
- ///////////////////// // //
- BULLET RAJA PRESENTS BUG REPORT SYSTEM
- */
- #define FILTERSCRIPT
- /****** INCLUDES *****/
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- #include <dini>
- #define COLOR_YELLOW 0xFFFF00FF
- new BRREPORT[MAX_PLAYERS][MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Bug Report System By BulletRaja");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:acceptreport(playerid, params[])
- {
- new tmp[256], id, name[MAX_PLAYER_NAME];
- if(IsPlayerAdmin(playerid)) return 0;
- if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /acceptreport [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_YELLOW, "Error: Invalid player id.");
- GetPlayerName(playerid, name, sizeof(name));
- if(BRREPORT[id][playerid]==0) return SendClientMessage(playerid, COLOR_YELLOW, "Error: That player didnt created bug report.");
- BRREPORT[id][playerid]=0;
- format(tmp, sizeof(tmp), "*%s has accepted your bug report", name);
- SendClientMessage(id, COLOR_YELLOW, tmp);
- GetPlayerName(id, name, sizeof(name));
- format(tmp, sizeof(tmp), "*You have accepted %s's bug report", name);
- SendClientMessage(playerid, COLOR_YELLOW, tmp);
- return 1;
- }
- CMD:closereport(playerid, params[])
- {
- new tmp[256], id, Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME];
- if(IsPlayerAdmin(playerid)) return 0;
- if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /closereport [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_YELLOW, "Error: Invalid player id.");
- GetPlayerPos(id, x, y, z);
- GetPlayerName(playerid, name, sizeof(name));
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z)) return SendClientMessage(playerid, COLOR_YELLOW, "Error: You must be at that player to close bug report.");
- if(BRREPORT[id][playerid]==0) return SendClientMessage(playerid, COLOR_YELLOW, "Error: That player didnt created bug report.");
- BRREPORT[id][playerid]=0;
- format(tmp, sizeof(tmp), "*%s has closed your bug report", name);
- SendClientMessage(id, COLOR_YELLOW, tmp);
- GetPlayerName(id, name, sizeof(name));
- format(tmp, sizeof(tmp), "*You have closed %s's bug report", name);
- SendClientMessage(playerid, COLOR_YELLOW, tmp);
- return 1;
- }
- CMD:reportbug2(playerid, params[])
- {
- new tmp[256], id, name[MAX_PLAYER_NAME], reason[128], sstring[256], playername[25], str[256];
- if(sscanf(params, "ds[128]", id, reason)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /reportbug2 [playerid] [reason]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_YELLOW, "Error: Invalid player id.");
- GetPlayerName(playerid, name, sizeof(name));
- BRREPORT[playerid][id]=1;
- format(tmp, sizeof(tmp), "* %s has reported an bug.(/acceptreport or /closereport)", name);
- SendClientMessage(id, COLOR_YELLOW, tmp);
- GetPlayerName(id, name, sizeof(name));
- format(tmp, sizeof(tmp), "* You have reported to %s ", name);
- SendClientMessage(playerid, COLOR_YELLOW, tmp);
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- format(str, sizeof(str), "You Have Reported: %s", reason);
- SendClientMessage(playerid, COLOR_YELLOW, str);
- format(sstring, sizeof(sstring), "%s has reported bug - %s.\r\n", playername, reason);
- format(str, sizeof(str), "Bug Log: %s has reported bug - %s.", playername, reason);
- SendClientMessageToAll(COLOR_YELLOW, str);
- printf("[ReportBug] %s has reported bug - %s.", playername, reason);
- new File: file = fopen("bugreport.cfg", io_append);
- fwrite(file, sstring);
- fclose(file);
- return 1;
- }
- CMD:checkbugs(playerid, params[])
- {
- if(IsPlayerAdmin(playerid)) return 0;
- new strings[128], File: file = fopen("bugreport.cfg", io_read), idxx=1;
- SendClientMessage(playerid, COLOR_YELLOW, "[BugReports]:");
- while(fread(file, strings))
- {
- format(strings, sizeof(strings), "%d) %s", idxx, strings);
- SendClientMessage(playerid, COLOR_YELLOW, strings);
- idxx ++;
- }
- fclose(file);
- return 1;
- }
Add Comment
Please, Sign In to add comment