Help with report system -
iOxide - 04.06.2014
Hello, i have this report command:
pawn Код:
CMD:report(playerid, params[])
{
new target, Name[24], ReporterName[24], Reason[128], Msg[128];
if (pInfo[playerid][LoggedIn] == true)
{
if (sscanf(params, "us[128]", target, Reason)) return SendClientMessage(playerid, RED, "USAGE: /report [ID] [Reason]");
if(target == playerid) return SendClientMessage(playerid, RED, "You cannot report yourself!");
if (pInfo[target][LoggedIn] == true)
{
GetPlayerName(target, Name, sizeof(Name));
SendAdminText(playerid, "/REPORT", params);
GetPlayerName(playerid, ReporterName, sizeof(ReporterName));
format(Msg, 128, "*** Player %s (ID: %d) has reported player %s (ID:%d). (Reason: %s )", ReporterName, playerid, Name, target, Reason);
MessageToAdmins(RED, Msg);
SendClientMessage(playerid, YELLOW, "Report sent to online Admins/Operators. Thanks for reporting!");
}
else SendClientMessage(playerid, RED, "Player isn't connected!");
}
else return 0;
return 1;
}
What i want to know is, if a player has reported someone and if an admin spec the reported player, it will send the message to the reporter saying "An Admin is checking your report"
I tried to make this and couldn't figure out how to. Can someone suggest me?
Re: Help with report system -
MacT - 04.06.2014
You need if any admin is online then send message to him.
pawn Код:
CMD:report(playerid, params[])
{
new target, Name[24], ReporterName[24], Reason[128], Msg[128];
if (pInfo[playerid][LoggedIn] == true)
{
if (sscanf(params, "us[128]", target, Reason)) return SendClientMessage(playerid, RED, "USAGE: /report [ID] [Reason]");
if(target == playerid) return SendClientMessage(playerid, RED, "You cannot report yourself!");
if (pInfo[target][LoggedIn] == true)
{
GetPlayerName(target, Name, sizeof(Name));
SendAdminText(playerid, "/REPORT", params);
GetPlayerName(playerid, ReporterName, sizeof(ReporterName));
format(Msg, 128, "*** Player %s (ID: %d) has reported player %s (ID:%d). (Reason: %s )", ReporterName, playerid, Name, target, Reason);
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i)){
SendClientMessage(i, 0x555252AA, Msg);
SendClientMessage(playerid, YELLOW, "Report sent to online Admins/Operators. Thanks for reporting!");
}
}
else SendClientMessage(playerid, RED, "Player isn't connected!");
}
else return 0;
return 1;
}
Re: Help with report system -
MattTucker - 04.06.2014
You can create a global variable something like
pawn Код:
new GotAReported=0;
new AReported=0;
Then when the player uses /report, the report command would be like this
pawn Код:
CMD:report(playerid, params[])
{
new target, Name[24], ReporterName[24], Reason[128], Msg[128];
if (pInfo[playerid][LoggedIn] == true)
{
if (sscanf(params, "us[128]", target, Reason)) return SendClientMessage(playerid, RED, "USAGE: /report [ID] [Reason]");
if(target == playerid) return SendClientMessage(playerid, RED, "You cannot report yourself!");
if (pInfo[target][LoggedIn] == true)
{
GetPlayerName(target, Name, sizeof(Name));
SendAdminText(playerid, "/REPORT", params);
GetPlayerName(playerid, ReporterName, sizeof(ReporterName));
format(Msg, 128, "*** Player %s (ID: %d) has reported player %s (ID:%d). (Reason: %s )", ReporterName, playerid, Name, target, Reason);
GotAReported = target;
AReported = playerid;
MessageToAdmins(RED, Msg);
SendClientMessage(playerid, YELLOW, "Report sent to online Admins/Operators. Thanks for reporting!");
}
else SendClientMessage(playerid, RED, "Player isn't connected!");
}
else return 0;
return 1;
}
Then under the /spec command, you can check if the targetid of the /spec equals the "GotAReported" (which is normally the ID of the guy that got reported) then you send a message to AReported (the player who used the report command) and send him a message saying that "An admin is checking your report."
PS:The "A" in 'A'Reported Got'A'Reported = admin, AdminReported, GotAdminReported, but shorter and such.
Good luck, hope it helps.
Re: Help with report system -
iOxide - 04.06.2014
@MacT, if you didn't understand what i am asking then you better not try to help. I already have the MessageToAdmin function created to send messages to admins.
@MattTucker, thanks. I will try to make it in that way.
Re: Help with report system -
MattTucker - 04.06.2014
Quote:
Originally Posted by iOxide
@MattTucker, thanks. I will try to make it in that way.
|
Inform me if you find any bugs, though it should work fine.