16.05.2014, 21:14
hey guys as you mgiht read the top i have question how can the /ar crash server or idk many cmds may crash it instantly idk why ...
code of /ar (( also added /tr and /dr cmd ))
code of /ar (( also added /tr and /dr cmd ))
Код:
CMD:ar(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128], reportid; if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ar [reportid]"); if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, " Report ID not below 0 or above 999!"); return 1; } if(Reports[reportid][BeingUsed] == 0) { SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!"); return 1; } if(!IsPlayerConnected(Reports[reportid][ReportFrom])) { SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !"); Reports[reportid][ReportFrom] = 999; Reports[reportid][BeingUsed] = 0; return 1; } format(string, sizeof(string), "AdmCmd: %s has accepted the report from %s (ID: %i, RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]),Reports[reportid][ReportFrom],reportid); ABroadCast(COLOR_ORANGE, string, 2); AddReportToken(playerid); // Report Tokens format(string, sizeof(string), "%s has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.", GetPlayerNameEx(playerid)); SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string); PlayerInfo[playerid][pAcceptReport]++; Reports[reportid][ReplyTimerr] = SetTimerEx("ReplyTimer", 30000, 0, "d", reportid); Reports[reportid][CheckingReport] = playerid; Reports[reportid][BeingUsed] = 0; Reports[reportid][TimeToExpire] = 0; strmid(Reports[reportid][Report], "None", 0, 4, 4); } return 1; } CMD:tr(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128], reportid; if(sscanf(params, "d", reportid)) return SendClientMessageEx(playerid, COLOR_WHITE,"USAGE: /tr [reportid]"); if(reportid < 0 || reportid > 999) { SendClientMessageEx(playerid, COLOR_GREY, " Report ID not below 0 or above 999!"); return 1; } if(Reports[reportid][BeingUsed] == 0) { SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!"); return 1; } if(!IsPlayerConnected(Reports[reportid][ReportFrom])) { SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !"); Reports[reportid][ReportFrom] = 999; Reports[reportid][BeingUsed] = 0; return 1; } format(string, sizeof(string), "AdmCmd: %s has trashed the report from %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom])); ABroadCast(COLOR_ORANGE, string, 2); format(string, sizeof(string), "%s has marked your report invalid. It will not be reviewed. Please check /reporttips", GetPlayerNameEx(playerid)); SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string); PlayerInfo[playerid][pTrashReport]++; Reports[reportid][ReportFrom] = 999; Reports[reportid][BeingUsed] = 0; Reports[reportid][TimeToExpire] = 0; strmid(Reports[reportid][Report], "None", 0, 4, 4); } return 1; } CMD:dr(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new string[128], reportid, reason[128]/*, y,m,d,h,mi,s*/; if(sscanf(params, "ds[128]", reportid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE,"{6347AA}[Error]:{FFFFFF} /dr [reportid] [Reason]"); if(reportid < 0 || reportid > 999) return SendClientMessageEx(playerid, COLOR_GREY, " Report ID not below 0 or above 999!"); if(Reports[reportid][BeingUsed] == 0) return SendClientMessageEx(playerid, COLOR_GREY, " That report ID is not being used!"); Reports[reportid][BeingUsed] = 0; if(!IsPlayerConnected(Reports[reportid][ReportFrom])) { SendClientMessageEx(playerid, COLOR_GREY, " The reporter has disconnected !"); Reports[reportid][ReportFrom] = 999; return 1; } //getdate(y, m, d); //gettime(h, mi, s); format(string, sizeof(string), "AdmCmd: %s has Denied %s report Reason: %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]),reason); ABroadCast(COLOR_ORANGE, string, 2); SendClientMessageEx(Reports[reportid][ReportFrom], 0x00FF0059, "______ .: REPORT DENIED :. ______"); format(string, sizeof(string), "Admin Name %s", GetPlayerNameEx(playerid)); SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string); format(string, sizeof(string), "Your Name %s", GetPlayerNameEx(Reports[reportid][ReportFrom])); SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string); format(string, sizeof(string), "Reason: %s", reason); SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string); //format(string, sizeof(string), "Correct Time&Date: %d/%d/%d %d:%d:%d [day/month/year hour:minute:second] ", d,m,y,h,mi,s); //SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string); SendClientMessageEx(Reports[reportid][ReportFrom], 0x00FF0059, "___________________________"); PlayerInfo[playerid][pTrashReport]++; Reports[reportid][ReportFrom] = 999; Reports[reportid][TimeToExpire] = 0; strmid(Reports[reportid][Report], "None", 0, 4, 4); } return 1; }