SA-MP Forums Archive
/me /do comand - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /me /do comand (/showthread.php?tid=221337)



/me /do comand - davelord - 05.02.2011

Hey, one of my friends made me a /me command once but i lost it. Can one of you give me a new emote command? No login stuff please, since i can make it on my own. Just a simple command with the colours: 0xFFA6FFFF, And a /do command please. Thanks


Re: /me /do comand - Matej_ - 05.02.2011

Got this from the wiki:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        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(0xFFFF00AA, str);
        return 1;
    }
    return 0;
pawn Код:
if(strcmp(cmd, "/do", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /do [action]");
                return 1;
            }
            if(PlayerInfo[playerid][pMaskuse] == 1)
            {
                format(string, sizeof(string), "* %s (( Stranger ))", result);
            }
            else
            {
                format(string, sizeof(string), "* %s (( %s ))", result, sendername);
            }
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            printf("%s", string);
        }
        return 1;
    }



Re: /me /do comand - davelord - 05.02.2011

From the /do:

Код:
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : error 017: undefined symbol "sendername"
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : error 017: undefined symbol "sendername"
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : warning 217: loose indentation
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : fatal error 107: too many error messages on one line



Re: /me /do comand - xRyder - 05.02.2011

Use ZCMD. Will be a lot easier and better.


Re: /me /do comand - davelord - 05.02.2011

I want to try this out first..


Re: /me /do comand - Matej_ - 05.02.2011

Quote:
Originally Posted by davelord
Посмотреть сообщение
From the /do:

Код:
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : error 017: undefined symbol "sendername"
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : error 017: undefined symbol "sendername"
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : warning 217: loose indentation
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : error 029: invalid expression, assumed zero
C:\Users\Mijn pc\Desktop\runescape priv\gamemodes\roleplaying commands.pwn(102) : fatal error 107: too many error messages on one line

pawn Код:
new sendername;



Re: /me /do comand - MadeMan - 05.02.2011

pawn Код:
new sendername[24];