Help in making /reports command
#1

I don't know how to make /reports command to load the reports done from /report command, help please

pawn Код:
COMMAND:report(playerid,params[])
{
      new str[128], string[128], target, reporter[MAX_PLAYER_NAME], reported[MAX_PLAYER_NAME];
      GetPlayerName(playerid, reporter, MAX_PLAYER_NAME);
      if(sscanf(params, "us[128]", target, str)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /report [playerid] [reason]");
      if(target == playerid) return SendClientMessage(playerid, 0xFF0000AA, "You Cannot Report Yourself!");
      if(!IsPlayerConnected(target) || target == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player Is Not Connected.");
      GetPlayerName(target, reported, MAX_PLAYER_NAME);
      SendClientMessage(playerid, 0xFFF700FF, "You Report Has Successfully Sent To Online Admins, Thanks For Reporting!");
      foreach(Player, i)
      {
      if(PlayerInfo[i][pAdmin] > 0)
      {
      format(string, sizeof(string), "[Report]: %s (%d) Is Reporting %s (%d) -  Reason: %s.", reporter, playerid, reported, target, str);
      SendClientMessage(i, 0xFFA600AA, string);
      }
      }
      return 1;
}
Reply
#2

what do you mean with load? Do you want the report to be shown on the screen in the chat of the admin or in a dialog?
Reply
#3

Quote:
Originally Posted by xCrazyMonkey
Посмотреть сообщение
what do you mean with load? Do you want the report to be shown on the screen in the chat of the admin or in a dialog?
I think he means he would like to allow admins to load the reports that have been made.

I.E: /showreports would show a dialog or alike with all current reports.

@OP
You will have to store the reports in a variable or alike to do this. (if that's what you want)
Reply
#4

ahh how can i do that?, can anyone give me an example
Reply
#5

Hello? Anyone?
Reply
#6

PHP код:
COMMAND:report(playeridparams[])
{
    new 
pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], str[128], reasoniD;
    if (
sscanf(params"dz"iDreason)) return SendClientMessage(playerid0xAA3333AA"Usage: /report [id] [reason]");
    if (
iD == INVALID_PLAYER_ID) return SendClientMessage(playerid0xAA3333AA"Invalid ID.");
    
GetPlayerName(playeridpNamesizeof(pName));
    
GetPlayerName(iDaNamesizeof(aName));
    
SendClientMessage(playerid,COLOR_RED,"Your report has been sent to admins");
    for (new 
0MAX_PLAYERSi++)
    {
        if (
IsPlayerConnected(i))
        {
            new 
zName[MAX_PLAYER_NAME], pFile[256];
            
GetPlayerName(izNamesizeof(zName));
            
format(pFilesizeof(pFile), "Admin\%s.ini"zName);
            if (
PInfo[playerid][Level] <1)
            {
                
format(strsizeof(str), "%s(%d) has reported %s(%d) for: %s"pNameplayeridaNameiDreason);
                
SendClientMessage(i0xFFFFFFFFstr);
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)