SA-MP Forums Archive
Roleplay commands - 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: Roleplay commands (/showthread.php?tid=605001)



Roleplay commands - iCurse - 13.04.2016

Where can i find a more decent /me, /(s)hout, /do, /(l)ow or any kind of roleplay chat commands?

I found one but it doesn't explain each line. I need a tutorial where it explains for me to understand what are the cause and effect of it.


Re: Roleplay commands - Godey - 13.04.2016

Here: https://sampforum.blast.hk/showthread.php?tid=470093
If you didn't understand, let us explain


Re: Roleplay commands - iCurse - 13.04.2016

That is the thread that i found, but if you insist on explaining it to me okay, why not.


Re: Roleplay commands - Godey - 13.04.2016

Код:
CMD:me(playerid, params[]) // Here you begin your ZCMD command!
{
    new string[128], act[100]; // Define the 2 variables ( string and act )
    if(sscanf(params, "s[100]", act)) // Here you check if player has written /me something PROPERLY
    {
        SendClientMessage(playerid, -1, "USAGE: /me [action]"); // if he/she wrote it wrong it will send message how to use it PROPERLY
        return 1; // exit loop
    }
    else  // if he entered it PROPERLY then,
    {
        format(string, sizeof(string), "* %s %s", GetName(playerid), act); // format(); prepares the message to be sent
        SendClientMessageToAll(-1, string); // This send message to all the players
    }
    return 1; //exit loop
}
OTHER INFO:
[1]: -1 can be changed to your favorite color
[2]:  You can change the "* %s %s" to anything, but remember since there is GetName and act there has to be 2 specifiers ( %s %s )



Re: Roleplay commands - iCurse - 13.04.2016

SendClientMessage(playerid, -1, "USAGE: /me [action]");

What is the "-1"? Isn't it supposed to be a color not a number?


Re: Roleplay commands - Godey - 13.04.2016

-1 means WHITE by default
well, yes. It has to be a color code
but if you want to use White, you can use -1 instead of the color code