command(report, playerid, params[]) {
new report[128], name[24];
if(sscanf(params, "s[128]", report)) return SendClientMessage(playerid, -1, "/report [reason]");
GetPlayerName(playerid, name, 24);
format(report, sizeof(report), "%s report's %s", name, report);
for(new i = 0; i != MAX_PLAYERS; ++i) {
if(AdminLevel[i] > 0) {
SendClientMessage(i, -1, report);
}
}
return 1;
}
command(report, playerid, params[]) {
new report[128], name[24];
if(sscanf(params, "s[128]", report)) return SendClientMessage(playerid, -1, "/report [reason]");
GetPlayerName(playerid, name, 24);
format(report, sizeof(report), "%s report's %s", name, report);
for(new i = 0; i != MAX_PLAYERS; ++i) {
if(AdminLevel[i] > 0) return SendClientMessage(i, -1, report);
}
return 1;
}
dcmd_report(playerid, params[]) // i don't use dcmd, idk about this line
{
new s_text[128], s_string[128], ID, pname[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
if(sscanf(params, "us[128]", ID, s_text)) return SendClientMessage(playerid, -1, "Usage: /report [playerid] [reason]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Invalid ID!");
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(ID, aname, sizeof(aname));
format(s_string, sizeof(s_string), "%s(%d) has reported %s(%d) Reason: %s", pname, playerid, aname, ID, s_text);
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{
if(IsPlayerAdmin(playerid) || AdminLevel[playerid] >= 1)
{
SendClientMessage(playerid, Color, s_string);
}
}
SendClientMessage(playerid, -1, "Your report has been sent to the current admins. The report will be checked. Thank you.");
return 1;
}
if (AdminLevel == 1) { //Show the (/Report) };
Its a Very Basic Command
Basically You'll Need to Check if Player is Administrator or Not. I'm Not Sure how you Program but my 'C++ Way' Would be Somthing as Follows Using Pvars/Gvars May be a Possiblity. Код:
if (AdminLevel == 1) { //Show the (/Report) }; I Myself, Dont Use That; Cheers; Ricey |
if(AdminLevel[i] > 0) return SendClientMessage(i, COLOR, report);