Report system, /reply without PlayerID
#1

Im trying to create a report system for my gm.
It has been good so far until now.

What im trying to is.
Player can /report [PlayerID] [Message], Admins receives this messages (Works!)
Admin can /drp [PlayerID] (Deny report) or /arp [PlayerID](Accept report)(Works!)
After accepting both player and admin can use /reply [Message] to send messages to each other.(Doesn't works!)
After chatting admin can /crp [PlayerID] (Close report) (Works!)
pawn Код:
new Reporter[MAX_PLAYERS];
new Accepter[MAX_PLAYERS];
new ReportStatus[MAX_PLAYERS];

// OnPlayerConnect
Reporter[playerid] = 0;
Accepter[playerid] = 1000;
ReportStatus[playerid] = 0;
/arp CMD
pawn Код:
CMD:arp(playerid, params[])
{
    new targetid, string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command.");
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /arp [PlayerID]");
    if(Accepter[playerid] < 1000) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: You are already handling a report.");
    if(Reporter[targetid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: This player has not submitted a report.");
    if(ReportStatus[targetid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Someone else is already taking care of this report");

    else if(ReportStatus[targetid] == 0)
    {
        ReportStatus[targetid] = 1;
        format(string, sizeof(string), "AdmCmd: %s has accepted the report of %s.", RPName(playerid), RPName(targetid));
        SendAdminMessage(COLOR_RED, string);
        Accepter[playerid] = targetid;
        Accepter[targetid] = playerid;
        SendClientMessage(playerid, COLOR_WHITE, "Warning: You have accepted a report, you can talk with him using /reply [Message]");
        SendClientMessage(targetid, COLOR_WHITE, "Warning: A admin has accepted your report, you can talk with him using /reply [Message]");
        SendClientMessage(playerid, COLOR_WHITE, "Warning: If you are done with the player, please close the report using /crp [PlayerID]");
    }
    return 1;
}
But then the problem is.
I don't know how to make the /reply cmd without forcing the player to fill in a playerID
pawn Код:
CMD:reply(playerid, params[])
{
    new targetid, string[128];
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /reply [Message]");
    if(Accepter == playerid || Accepter == targetid)
This is how i wanted to do it.
But that shouldn't work because i have to define targetid but how.. ?
Reply
#2

Its late here but,

pawn Код:
CMD:reply(playerid, params[])
{
* * new targetid, string[128];
* * if(sscanf(params, "ds[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /reply [id] [Message]");
* * if(Accepter == playerid || Accepter == targetid)
Reply
#3

I know its midnight.
But like i said. I DON'T want them to fill a PlayerID
Reply
#4

pawn Код:
if(Accepter == playerid || Accepter == targetid)
Why do you even need that? You just saved the id you need in a variable, didn't you?
pawn Код:
SendClientMessage(Accepter[playerid], -1, params);
Reply
#5

Sorry i forgot to finish that line. That should be :
pawn Код:
if(Accepter[targetid] == playerid || Accepter[playerid] == targetid)
So if a another admin also handling a report the msgs dont get mixed up.

EDIT: Nvm . I was tired/its late so my way of thinking was screwed up. Thanks for the clearance. Also my phone is scrwwing up the font size..?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)