[Help] RP commands /me /do
#6

pawn Code:
//----------------------------------[ME]-----------------------------------------------
    if(strcmp(cmd, "/me", 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: /me [action]");
                return 1;
            }
            if(PlayerInfo[playerid][pMaskuse] == 1)
            {
                format(string, sizeof(string), "* Stranger %s", result);
            }
            else
            {
                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;
    }

//----------------------------------[Do]-----------------------------------------------
    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;
    }
Try this and to you have error reply this here
Reply


Messages In This Thread
[Help] RP commands /me /do - by dovys11 - 24.06.2010, 08:33
Re: [Help] RP commands /me /do - by TouR - 24.06.2010, 08:36
Re : [Help] RP commands /me /do - by Amine_Mejrhirrou - 23.01.2011, 15:03
Re: [Help] RP commands /me /do - by Not available - 23.01.2011, 15:06
Re : [Help] RP commands /me /do - by Amine_Mejrhirrou - 23.01.2011, 19:55
Re: [Help] RP commands /me /do - by Elviss - 23.01.2011, 20:04
Re: [Help] RP commands /me /do - by bestr32 - 03.04.2011, 17:26
Re: [Help] RP commands /me /do - by bestr32 - 03.04.2011, 17:28
Re: [Help] RP commands /me /do - by Luis- - 03.04.2011, 17:29
Re: [Help] RP commands /me /do - by Mean - 03.04.2011, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)