/report Help
#2

Snip from a GF script:

pawn Код:
if(strcmp(cmd, "/report", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [text]");
                return 1;
            }
            format(string, sizeof(string), "Report from [%d]%s: %s", playerid, sendername, (result));
            ABroadCast(COLOR_YELLOW,string,1);
            SendClientMessage(playerid, COLOR_YELLOW, "Your Report Message was sent to the Admins.");
      }
      return 1;
    }
ABroadcast is a function that gets all admins on server and sends the message to them.
If you don't know how to make it:

pawn Код:
forward ABroadCast(color,const string[],level);
pawn Код:
public ABroadCast(color,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if (PlayerInfo[i][pAdmin] >= level)
            {
                SendClientMessage(i, color, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
/report Help - by omgunoobjk - 23.05.2010, 10:37
Re: /report Help - by Blt950 - 23.05.2010, 10:40
Re: /report Help - by DJDhan - 23.05.2010, 10:41
Re: /report Help - by omgunoobjk - 23.05.2010, 10:45
Re: /report Help - by Blt950 - 23.05.2010, 10:50
Re: /report Help - by omgunoobjk - 23.05.2010, 10:53
Re: /report Help - by Blt950 - 23.05.2010, 10:56

Forum Jump:


Users browsing this thread: 1 Guest(s)