SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 23/02/2011, 11:57 PM   #1
tanush
Huge Clucker
 
Join Date: Feb 2010
Posts: 490
Reputation: 2
Default /me For RP Servers

Most newbie might make rp and want to know how to make /me [action] CMD for example
* Tanush has punched CJ by the nose

Like if you do /me punches CJ by the nose. on server it will show to everyone * [yourname] punches CJ by the nose

ok Under OnPlayerCommandText add
pawn Code:
if(!strcmp(cmdtext, "/me", true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0xFF9900AA, str);
        return 1;

Your script should look like
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0xFF9900AA, str); //I put orange cause i like it, you could change colour if you want to -.-
        return 1;
     }
     return 0;
}

pictures for example

LOOK AT SECOND LINE where it says * Zack_Bruseli shows middle finger". it will look like that

NOTICE:It's my first tutorial, i wish you like it .

Last edited by tanush; 24/02/2011 at 12:40 AM. Reason: why you wanna know?
tanush is offline   Reply With Quote
Old 24/02/2011, 12:29 AM   #2
Snipa
Banned
 
Join Date: May 2010
Posts: 815
Reputation: 115
Default Re: /me For RP Servers

Explain a little more for it to be a tutorial, but ok for a first time.
Snipa is offline   Reply With Quote
Old 24/02/2011, 12:35 AM   #3
tanush
Huge Clucker
 
Join Date: Feb 2010
Posts: 490
Reputation: 2
Default Re: /me For RP Servers

sure wait
tanush is offline   Reply With Quote
Old 24/02/2011, 02:10 AM   #4
BladerDildo
Little Clucker
 
Join Date: Nov 2010
Posts: 13
Reputation: 0
Default Re: /me For RP Servers

Explain more please, by the way this is really useful.
BladerDildo is offline   Reply With Quote
Old 24/02/2011, 06:56 AM   #5
Haydz
Gangsta
 
Haydz's Avatar
 
Join Date: Jul 2010
Location: New Zealand
Posts: 752
Reputation: 44
Default Re: /me For RP Servers

Quote:
Originally Posted by Las Venturas CNR View Post
Fail, you copied SA-MP Wiki, and changed the color.
http://wiki.sa-mp.com/wiki/Using_strcmp%28%29
This, and you failed to explain what everything does.
__________________

Don't view these forums much anymore, still check every once and awhile so if you send me a PM It'll take a bit for me to respond!
Haydz is offline   Reply With Quote
Old 24/02/2011, 07:19 AM   #6
admantis
High-roller
 
Join Date: Sep 2009
Posts: 2,531
Reputation: 449
Default Re: /me For RP Servers

1 - Copy & Paste
2 - No explanation; no tutorial
admantis is offline   Reply With Quote
Old 24/02/2011, 07:39 AM   #7
Abreezy
Gangsta
 
Abreezy's Avatar
 
Join Date: Jan 2011
Location: Bronx
Posts: 560
Reputation: 42
Default Re: /me For RP Servers

should use zcmd.
Abreezy is offline   Reply With Quote
Old 24/02/2011, 08:42 AM   #8
alpha500delta
High-roller
 
alpha500delta's Avatar
 
Join Date: Feb 2010
Posts: 1,152
Reputation: 91
Default Re: /me For RP Servers

By the way this is not for RP servers, it shows for every player, not in a range...
__________________
Skype: Alpha500delta | Steam: Alpha500delta
alpha500delta is offline   Reply With Quote
Old 26/02/2011, 12:50 AM   #9
Nat_Pagle
Little Clucker
 
Join Date: Oct 2009
Posts: 12
Reputation: 0
Default Re: /me For RP Servers

Quote:
Originally Posted by alpha500delta View Post
By the way this is not for RP servers, it shows for every player, not in a range...
Yes I just tried this and noticed, how would I add it to be a specific range?
Nat_Pagle is offline   Reply With Quote
Old 26/02/2011, 09:00 AM   #10
alpha500delta
High-roller
 
alpha500delta's Avatar
 
Join Date: Feb 2010
Posts: 1,152
Reputation: 91
Default Re: /me For RP Servers

You can use ProxDetector (link in my signature)
But you can better use your own system, using GetNearestPlayer function (Whoever made that)
or IsPlayerInRangeOfPoint
__________________
Skype: Alpha500delta | Steam: Alpha500delta
alpha500delta is offline   Reply With Quote
Reply

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
:'([how] can i see my servers ip?????? superkulaway Server Support 13 11/02/2013 03:23 AM
RP Servers grimmy149 General 8 18/08/2009 07:55 PM
servers don't show up...0 players, playing on 0 servers kevin71394 Client Support 14 17/07/2009 12:31 PM
THIS IS TO BIG SERVERS ONLY! shady91 General 21 29/06/2009 04:31 AM


All times are GMT. The time now is 02:22 PM.


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