Need help with whisper (/w) cmd.
#1

hello guys here is the code of my whisper cmd

Код:
CMD:w(playerid, params[])
{
    new text[128], string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /w [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "%s Whispers:  %s ", RPN(playerid), params);
    SendNearbyMessage(playerid, 10, string, COLOR_ORANGE, COLOR_ORANGE, COLOR_ORANGE, COLOR_ORANGE, COLOR_ORANGE);
    new log[256];
    format(log, sizeof(log), "%s Whispers: %s", RPN(playerid), text);
    Log("logs/whisper.log", log);
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] >= 6 && Whispers[i] && i != playerid)
        {
            format(log, sizeof(log), "[WHISPER] %s : %s", RPN(playerid), text);
            SendClientMessage(i, COLOR_YELLOW, log);
        }
    }
    return 1;
}
i want that when someone whispers level 6+ admin can hear that and it should be stored in whisper logs too. Thanks in advance.
Reply
#2

I am assuming your error is here:
pawn Код:
SendClientMessage(COLOR_YELLOW, log);
It should be this:
pawn Код:
SendClientMessage(i, COLOR_YELLOW, log);
Reply
#3

Yeah, CSRP is right, this is your error for sure.
Reply
#4

Quote:
Originally Posted by vernz
Посмотреть сообщение
Yeah, CSRP is right, this is your error for sure.
GSRP. :P
Reply
#5

Thanks and will it show the whispers done to admins if /listen whisper is on?
Reply
#6

Yes, it should. If it doesn't, just re-post here and I will help you.
Reply
#7

Alright, and thanks for your support.
Reply
#8

Bump its not showing Whispers to admins, need help. Thanks
Reply
#9

Bump
Reply
#10

BUMP still need help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)