SA-MP Forums Archive
Need /me cmds - 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: Need /me cmds (/showthread.php?tid=597925)



Need /me cmds - Trollerz - 06.01.2016

TITLE SAYS EVERYTHING!


Re: Need /me cmds - saffierr - 06.01.2016

PHP код:
CMD:me(playeridparams[])
{
   new 
string[75], name[MAX_PLAYER_NAME];
   if(
isnull(params)) return SendClientMessage(playerid, -1"/me [text]");
   
GetPlayerName(playeridnameMAX_PLAYER_NAME);
   
format(stringsizeof string"%s %s %s"namestringparams);
   
SendClientMessageToAll(-1string);
   return 
1;




Re: Need /me cmds - OwlIT - 06.01.2016

pawn Код:
command(me, playerid, params[])
{
    new
        text[128], name[MAX_PLAYER_NAME];
       
    if(!IsPlayerConnected(playerid)) return 1;
    if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, -1, "USAGE: /me [action]");
   
    GetPlayerName(playerid, name, sizeof name);
    format(text, sizeof text, "* %s %s ", name, text);
    SendActionMessage(playerid, -1, text);
    return 1;
}

SendActionMessage(playerid, color, text[])
{
    new
        Float:range = 5.0, Float:X, Float:Y, Float:Z;
       
    GetPlayerPos(playerid, X, Y, Z);
    for(new i, j = GetPlayerPoolSize(); i <= j; i++)
    {
        if(IsPlayerInRangeOfPoint(i, range, X, Y, Z))
        {
            SendClientMessage(i, color, text);
        }
    }
    return 1;
}



Re: Need /me cmds - saffierr - 06.01.2016

Use the code of @owit if you want to have it for players in range of the player. My code is for the whole server