[Help] Admin Message
#1

Alright, so, a nice guy from this forum made me this CMD, but now I want to improve it a bit but I don't have the knowledge for that, could you help me out, pros?

pawn Код:
CMD:am(playerid, params[])
{
    new ToAdminsText[128], TargetID, MessageToAdmins[152], PlayerName[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] < 1 && sscanf(params, "s[128]", ToAdminsText)) return SendClientMessage(playerid, -1, "USAGE: /am [text]");
    if(PlayerInfo[playerid][pAdmin] > 0 && sscanf(params, "rs[128]",TargetID, ToAdminsText)) return SendClientMessage(playerid, -1, "USAGE: /am [id] [text]");
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(MessageToAdmins, sizeof(MessageToAdmins), "Admin Message from %s (ID: %d): %s", PlayerName, playerid, ToAdminsText);
    if(PlayerInfo[playerid][pAdmin] < 1)
    {
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdmin] > 0) SendClientMessage(i, -1, MessageToAdmins);
        }
    }
    else SendClientMessage(TargetID, COLOR_GREEN, MessageToAdmins);
    return 1;
}
I want it that when a player sends a message to admins a message returns to him like: Your message, ( what he typed), was sent to administrators. And that when an admin sends a message to a player all admins see something like this: Admin Message to %s (ID: %d): (message that he sent) from (admin that send the message). Could you help me out, please?
Reply
#2

I have one if you require it? it sends the message to the admins, and it shows the player exactly what the player sent. To the admin's it'll show "Incoming message from %s" and the admins can reply to this with another command sort of one you're looking for?
Reply
#3

I want it all with the same command, thanks anyways, mate! +repped, cheers.
Reply
#4

It appears that the ToAdminsText is the string which contains the contents of the report. If you would like the player to receive a message with what he reported, just send the player a client message which includes that string. Something like this:

pawn Код:
new returnmessage[128]; // Optimize this array when you get the time.
format(returnmessage, sizeof(returnmessage), "You have sent the following report: %s", ToAdminsText);
SendClientMessage(playerid, COLOR, returnmessage); // Make sure to input the color of your choice.
If you want help with admins sending messages, I will need to see the command that an admin uses to send the message. It will be somewhat similar to what I put above. See if the above can help you make the admin message change by yourself.
Reply
#5

That command is for admins to awsner aswell, and it's working.
Reply
#6

Quote:
Originally Posted by DuarteCambra
Посмотреть сообщение
That command is for admins to awsner aswell, and it's working.
Silly me, I've never seen a command like that. Suits me right for making assumptions instead of looking myself.
Reply
#7

Quote:
Originally Posted by RVRP
Посмотреть сообщение
Silly me, I've never seen a command like that. Suits me right for making assumptions instead of looking myself.
Not your fault, I've never seen a command like this aswell, that's why I'm asking for help, I'd be able to deal with a normal command. Anyways, thanks for your help, +repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)