27.12.2015, 17:54
don't use more strings you can do it with 1 string try this
PHP код:
CMD:cr(playerid, params[])
{
if(pInfo[playerid][AdminLevel] > 0)
{
new otherid, aName[MAX_PLAYER_NAME], string[256], othername[MAX_PLAYER_NAME], reason[256];
GetPlayerName(playerid, aName, sizeof(aName));
GetPlayerName(otherid, othername, sizeof(othername));
if(sscanf(params, "u", 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.");
if (sscanf(params, "us", otherid, reason))
{
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(string, sizeof(string), "> Admin %s: %s", aName, params);
submitToHelpersAndAdmins(string, COLOR_YELLOW);
SendClientMessage(playerid, -1, "Your report has been closed.");
}
else
{
format(string, sizeof(string), "> Admin %s: %s", aName, params);
submitToHelpersAndAdmins(string, COLOR_YELLOW);
format(string, sizeof(string), "Admin %s: %s", aName, params);
SendClientMessage(otherid, -1, string);
SendClientMessage(playerid, -1, "Your report has been closed.");
}
pInfo[otherid][HasReport] = 0;
pInfo[otherid][ReportAccepted] = 0;
}
else return SendClientMessage(playerid, 0xFF0000FF, "Error: You are not authorized to use this command!");
return 1;
}