SA-MP Forums Archive
Hello guys. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hello guys. (/showthread.php?tid=164521)



Hello guys. - GangsTa_ - 31.07.2010

Hello guys. Please help me making a Whisper command like /w [Message]
The command should make like when you write /w and a message , the message to be showed only to near players.
Just too lazy to /pm...


Re: Hello guys. - Kar - 31.07.2010

pawn Код:
CMD:w(playerid, cmdtext[])
    {
        new string[128];
        if(strlen(cmdtext) <= 3)
        {
            SendClientMessage(playerid, RED,"USAGE: /w (msg)");
            return 1;
        }
        new output[150];
        new pname[24];
        GetPlayerName(playerid, pname, 24);
        strmid(output,cmdtext,2,strlen(cmdtext));
        format(string, sizeof(string), "(WHISPER): %s [%d] %s",pname,playerid,output);
        printf("%s", string);
        for(new i=0;i<MAX_PLAYERS;i++)
        {
            if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 20)
            {
               format(string, sizeof(string), "(WHISPER): %s [%d] %s",pname,playerid,output);
               SendClientMessage(i, YELLOW,string);
            }
        }
        return 1;
    }



Re: Hello guys. - Karlip - 31.07.2010

Nice copy&paste, too bad it will only work for you, Kar.


Re: Hello guys. - Kar - 31.07.2010

i gave him mine.. L