Little help with sending message to admins
#1

Hello, i've been working on a report command, and i have got it all working, when the player reports, it files in the logs, but it should also send a message to all online admins, but it don't, could you please take a look at it.

Code

Код:
CMD:report(playerid, params[])
{
    new reason[128];
    if(sscanf(params, "us[128]", ID, reason)) return SCM(playerid, red, "--- /report <ID> <Reason> ---");
    new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sender, sizeof(sender));
    GetPlayerName(ID, receiver, sizeof(receiver));
    format(string, sizeof(string), "(report): %s(%d) has reported %s(%d) for %s", sender, playerid, receiver, ID, reason);
    SendReportToAdmins(string);
    ReportLog(playerid, string);
    return 1;
}
Код:
stock SendReportToAdmins(msg[])
{
    new string[128];
    format(string, sizeof(string), "(Report) %s", msg);
    for(new i; i < GetMaxPlayers(); i++)
    {
        if(pInfo[i][Adminlevel] < 1)
        {
            SCM(i, red, string);
        }
    }
}
If you could help me with that, it would be great! thank you!

I also want to know how to do something like this, when a player connects to the server it sends a message to players like
"Name has joined the server"
But i wanted to keep that the same, but if the player is admin it says
Name has joined the server (IP) So only admins can see the line with IP on it, if you could help me with that, it would be great, thank you! i will rep anyone who helps too!
Reply


Messages In This Thread
Little help with sending message to admins - by LeXuZ - 25.11.2014, 21:41
Respuesta: Little help with sending message to admins - by aoEXE - 25.11.2014, 21:49
Re: Little help with sending message to admins - by AnthonyTimmers - 25.11.2014, 22:03
Re: Little help with sending message to admins - by LeXuZ - 26.11.2014, 16:07

Forum Jump:


Users browsing this thread: 1 Guest(s)