SA-MP Forums Archive
Need help with whisper (/w) cmd. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with whisper (/w) cmd. (/showthread.php?tid=359879)



Need help with whisper (/w) cmd. - Marven - 15.07.2012

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.


Re: Need help with whisper (/w) cmd. - GSRP - 15.07.2012

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



Re : Need help with whisper (/w) cmd. - vernz - 15.07.2012

Yeah, CSRP is right, this is your error for sure.


Re: Re : Need help with whisper (/w) cmd. - GSRP - 15.07.2012

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


Re: Need help with whisper (/w) cmd. - Marven - 15.07.2012

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


Re: Need help with whisper (/w) cmd. - GSRP - 15.07.2012

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


Re: Need help with whisper (/w) cmd. - Marven - 16.07.2012

Alright, and thanks for your support.


Re: Need help with whisper (/w) cmd. - Marven - 17.07.2012

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


Re: Need help with whisper (/w) cmd. - Marven - 18.07.2012

Bump


Re: Need help with whisper (/w) cmd. - Marven - 20.07.2012

BUMP still need help.