Scripting questions
#6

pawn Код:
if(!strcmp(cmdtext, "/me", true)) // 3 is the length of /me
    {
        if(!cmdtext[4]) 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;
    }
It should really start from the 4th character, because players could simply do "/me " and the command would still be processed.
Reply


Messages In This Thread
Scripting questions - by Sarra - 02.08.2014, 19:24
Re: Scripting questions - by youssefehab500 - 02.08.2014, 19:37
Re: Scripting questions - by Snipa - 02.08.2014, 20:12
Re: Scripting questions - by dominik523 - 02.08.2014, 20:17
Re: Scripting questions - by Sarra - 02.08.2014, 20:53
Re: Scripting questions - by Threshold - 03.08.2014, 00:24

Forum Jump:


Users browsing this thread: 1 Guest(s)