[Help!] /me, /do and /ame commands!
#1

Hello, I'm posting this because I am creating a roleplay server. I have got the map implemented, a good administrator system and a lot of good filterscripts in my server.

However, I'm in dire need of a /me, /do and /ame command. Could anyone supply those commands for me please? Bare in mind: This is a roleplay server, so they all have to have a close proximity on them.

Thank you very much, I appreciate the work!
Reply
#2

which command processor are you using?
Reply
#3

What do you mean? (Sorry, rather new to all this scripting stuff, haha.)
Reply
#4

Then if you are new i would first suggest that you start with something small, like a DM gamemode.
Most people here will not explicitly make commands for someone who doesn't know the basics, or will not want to learn from it. Not being angry, just saying, read up a little and start small, a RP server takes a ton of work to get coded.
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=91354 <-- Is an example of a command processor.
Reply
#6

Thank you very much.

I know that RP servers are hard too code, however this server doesn't need a complex script (the server is based on a very, very small map). All we need is a fully working /me, /do and /ame and we're off.
Reply
#7

Well I'm afraid i cannot be of much help because it looks like you are using the built in command processor, and I forgot that when I moved to ZCMD and Y_command. If you're using one of those i'd be able to help
Reply
#8

No worries, I'll search around for some then.
Reply
#9

A simple /me, /do command filterscript with Strcmp ( slow command processor )

pawn Код:
#include < a_samp >

stock SendClosestMessage( playerid, color, const string[ ] )
{
    new
        Float: jPos[ 3 ]
    ;

    GetPlayerPos( playerid, jPos[ 0 ], jPos[ 1 ], jPos[ 2 ] );

    for ( new j = GetMaxPlayers( ), i; i < j; i ++ )
    {
        if ( !IsPlayerConnected( i ) )
            continue;

        if ( IsPlayerInRangeOfPoint( i, 5.0, jPos[ 0 ], jPos[ 1 ], jPos[ 2 ] ) )
        {
            SendClientMessage( i, color, string );
        }
    }

    return 1;
}

       

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if ( !strcmp( cmdtext, "/me", 3 ) )
    {
        if ( cmdtext[ 3 ] != ' ' || !cmdtext[ 4 ] )
            return SendClientMessage( playerid, -1, "Syntax: /me < action >" );
 
        new
            tempString[ 128 ],
            pName[ 24 ]
        ;

        GetPlayerName( playerid, pName, sizeof pName );

        format( tempString, sizeof tempString, "* %s %s", pName, cmdtext[ 3 ] );

        SendClosestMessage( playerid, -1, tempString );

        return 1;
    }

    if ( !strcmp( cmdtext, "/do", 3 ) )
    {
        if ( cmdtext[ 3 ] != ' ' || !cmdtext[ 4 ] )
            return SendClientMessage( playerid, -1, "Syntax: /do < action >" );
 
        new
            tempString[ 128 ],
            pName[ 24 ]
        ;

        GetPlayerName( playerid, pName, sizeof pName );

        format( tempString, sizeof tempString, "* (( %s )) %s", pName, cmdtext[ 3 ] );

        SendClosestMessage( playerid, -1, tempString );

        return 1;
    }

    return 0;
}
It's very simple!

EDIT: Added a "SendClosestMessage" function!
Reply
#10

Quote:
Originally Posted by Basicz
Посмотреть сообщение
with Strcmp ( slow command processor )
First, strcmp is not a command processor, it simply compares two strings and returns 0 if they are equal or returns a positive or negative number depending on which string is "Larger."

Second, strcmp is not slow, if I had only one command on my server (and using strcmp to check typed text) it would probably be faster than any other method, it would also maintain this speed if it was at the top of the list (supposing you use else if for the rest of the commands.)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)