08.06.2013, 21:51
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!)
/arp CMD
But then the problem is.
I don't know how to make the /reply cmd without forcing the player to fill in a playerID
This is how i wanted to do it.
But that shouldn't work because i have to define targetid but how.. ?
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;
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;
}
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)
But that shouldn't work because i have to define targetid but how.. ?