/me in a /do
#1

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;
Reply
#2

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

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

Use 128...

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

Do you seriously not know how to edit this?

It's REALLY self explanatory.
Reply
#5

wtf?

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

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;

Reply
#7

put a } after return 0; at the end.
Reply
#8

thanks!
Reply
#9

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]
Reply
#10

That is just an overall shitty code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)