27.12.2015, 12:40
Why are you using 'r' in sccanf to get player's id?
Try this:
Try this:
PHP код:
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, "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.");
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;
}
If didn't work, explain me whats wrong with it.