SA-MP Forums Archive
/me in a /do - 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 in a /do (/showthread.php?tid=223995)



/me in a /do - davelord - 10.02.2011

ok so, this is my /me command, and it is like this: [playername] [action] can you change the [playername] to [DO] [action]
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;



Re: /me in a /do - davelord - 10.02.2011

for example: /me eats a hotdog.
"John_Smith eats a hotdog."
Should become: /do is eating a hotdog
"[DO] is eating a hotdog"


Re: /me in a /do - DevilG - 10.02.2011

format(str, sizeof(str), "* %s %s", str, cmdtext[4]);

Use 128...

format(str, sizeof(str), "* [DO] %s", cmdtext[128]);


Re: /me in a /do - Memoryz - 10.02.2011

Do you seriously not know how to edit this?

It's REALLY self explanatory.


Re: /me in a /do - BMUK - 10.02.2011

wtf?

lol @ sig: If you try something yourself, you realise that it all isnt that hard. Davelord, since 2009 ©


Re: /me in a /do - davelord - 10.02.2011

Quote:

C:\Users\Mijn pc\Desktop\runescape priv\Server\gamemodes\test.pwn(103) : error 030: compound statement not closed at the end of file (started at line 81)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

(lines 81 untill 102)

Quote:

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;
}

if(!strcmp(cmdtext, "/do", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* [DO] %s", cmdtext[128]);
SendClientMessageToAll(0xFFFF00AA, str);
return 1;
}
return 0;




Re: /me in a /do - BMUK - 10.02.2011

put a } after return 0; at the end.


Re: /me in a /do - davelord - 10.02.2011

thanks!


Re: /me in a /do - davelord - 10.02.2011

Oh, by the way, i just tested the /me, The /me works properly, but when i type /DO it shows only this:
* [DO]
and it wont show any text i type in, only the *[do]


Re: /me in a /do - Antonio [G-RP] - 10.02.2011

That is just an overall shitty code.