27.12.2015, 12:27
Alright, so. I want to make it so when an admin types /cr [playerid] it will ony close the report.
But if he types /cr [playerid] [reason] it will close the report + it would send a message with the reason to the player.
Here is what I have.
For some reason it doesn't work.
But if he types /cr [playerid] [reason] it will close the report + it would send a message with the reason to the player.
Here is what I have.
Код:
CMD:cr(playerid, params[]) { if(pInfo[playerid][AdminLevel] > 0) { new otherid, aName[MAX_PLAYER_NAME], string[256], othername[MAX_PLAYER_NAME], string2[256], string3[256]; GetPlayerName(playerid, aName, sizeof(aName)); GetPlayerName(otherid, othername, sizeof(othername)); if(sscanf(params, "r", otherid)) return SendClientMessage(playerid, COLOR_GREY, "Usage: {FFFFFF}/cr [playerid/name] + [reason]"); { if(otherid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "That player is not connected."); if(pInfo[otherid][HasReport] == 0) return SendClientMessage(playerid, COLOR_GREY, "That player does not have any reports available."); format(string, sizeof(string), "* Admin %s has closed the report from %s [%d, level %d]: %s", aName, othername, otherid, pInfo[otherid][Level], pInfo[otherid][Report]); submitToHelpersAndAdmins(string, COLOR_HOTORANGE); format(string2, sizeof(string2), "> Admin %s: %s", aName, params); submitToHelpersAndAdmins(string, COLOR_YELLOW); SendClientMessage(playerid, -1, "Your report has been closed."); pInfo[otherid][HasReport] = 0; pInfo[otherid][ReportAccepted] = 0; } if(sscanf(params, "rs", otherid, params)) return SendClientMessage(playerid, COLOR_GREY, "Usage: {FFFFFF}/cr [playerid/name] + [reason]"); { format(string2, sizeof(string2), "> Admin %s: %s", aName, params); submitToHelpersAndAdmins(string2, COLOR_YELLOW); format(string3, sizeof(string3), "Admin %s: %s", aName, params); SendClientMessage(otherid, -1, string3); SendClientMessage(playerid, -1, "Your report has been closed."); pInfo[otherid][HasReport] = 0; pInfo[otherid][ReportAccepted] = 0; } } else return SendClientMessage(playerid, -1, NotAdmin); return 1; }