#1

I am trying to make a local /me cmd

pawn Код:
if(strcmp(cmdtext, "/me", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new string[256];
            new sendername[MAX_PLAYER_NAME];
            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_RED, "USAGE: /me [action]");
                return 1;
            }
            format(string, sizeof(string), "* %s %s", sendername, result);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            printf("%s", string);
        }
        return 1;
    }
I got some errors after defining something on "idx"
Reply


Messages In This Thread
/me - by GangsTa_ - 22.08.2010, 12:37
Re: /me - by Jochemd - 22.08.2010, 12:42
Re: /me - by iggy1 - 22.08.2010, 12:45
Re: /me - by GangsTa_ - 22.08.2010, 16:00
Re: /me - by [XST]O_x - 22.08.2010, 16:16
Re: /me - by GangsTa_ - 23.08.2010, 09:30
Re: /me - by Hiddos - 23.08.2010, 09:51
Re: /me - by Vince - 23.08.2010, 10:43

Forum Jump:


Users browsing this thread: 7 Guest(s)