SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 31/07/2010, 06:41 PM   #1
GangsTa_
High-roller
 
GangsTa_'s Avatar
 
Join Date: May 2010
Location: Republic of Moldova
Posts: 1,149
Reputation: 51
Default Hello guys.

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...
GangsTa_ is offline  
Old 31/07/2010, 06:46 PM   #2
Kar
High-roller
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,876
Reputation: 280
Default Re: Hello guys.

pawn Code:
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;
    }
__________________

  • Twisted Metal's Website & Forums are up! http://tm.lvcnr.net

    Are you prepared to get your wish? Twisted Metal SA-MP is coming soon! Join the IRC Channel: #tm on irc.tl - @tmsamp_dev

server.lvcnr.net:7777 | samp://server.lvcnr.net:7777
www.lvcnr.net | @kcnrdev
Channel: #lvcnr on irc.tl
Kar is offline  
Old 31/07/2010, 06:52 PM   #3
Karlip
High-roller
 
Join Date: Oct 2007
Location: Click To Show
Posts: 1,883
Reputation: 100
Default Re: Hello guys.

Nice copy&paste, too bad it will only work for you, Kar.
__________________
Karlip is offline  
Old 31/07/2010, 07:00 PM   #4
Kar
High-roller
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,876
Reputation: 280
Default Re: Hello guys.

i gave him mine.. L
__________________

  • Twisted Metal's Website & Forums are up! http://tm.lvcnr.net

    Are you prepared to get your wish? Twisted Metal SA-MP is coming soon! Join the IRC Channel: #tm on irc.tl - @tmsamp_dev

server.lvcnr.net:7777 | samp://server.lvcnr.net:7777
www.lvcnr.net | @kcnrdev
Channel: #lvcnr on irc.tl
Kar is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help Guys! Killerr1234 Help Archive 3 30/04/2010 09:45 PM
Hi guys! Help? lionlev Help Archive 11 24/03/2010 04:32 PM
Help me guys Simd4 Client Support 2 11/09/2009 05:29 PM
Help Plz GuYs Ceasar_Vialpando Help Archive 3 03/09/2009 05:11 PM
i need help guys Ceasar_Vialpando Help Archive 2 30/07/2009 03:31 PM


All times are GMT. The time now is 12:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.