Shout command
#10

Okay I make it work somehow with your help guys but now there is the problem when I write /b or /d or /c or any command that does not exist it will write "/(s)hout [local chat]" here is the command

pawn Код:
if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, Name, sizeof(Name));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[256];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid,COLOR_LIGHTGREEN, "(/s)hout [local chat]");
                return 1;
            }
            if(Masked[playerid] == 1) format(Str, sizeof(Str), "* Stranger shouts: %s",result);
            else format(Str, sizeof(Str), "%s shouts: %s!",Name,result);
            SendClientMessage(playerid,COLOR_LIGHTGREEN, Str);
            //ProxDetector(30.0, playerid, Str,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
            printf("- /shout:  %s", Str);
        }
        return 1;
    }
How ti fix it ? :/
Reply


Messages In This Thread
Shout command - by Lajko1 - 26.10.2013, 22:22
Re: Shout command - by Pottus - 26.10.2013, 22:26
Re: Shout command - by Lajko1 - 26.10.2013, 22:30
Re: Shout command - by Pottus - 26.10.2013, 22:46
Re: Shout command - by Mattakil - 26.10.2013, 23:41
Re: Shout command - by Lajko1 - 27.10.2013, 05:33
Re: Shout command - by -CaRRoT - 27.10.2013, 05:45
Re: Shout command - by Lajko1 - 27.10.2013, 07:45
Re: Shout command - by Tomix - 27.10.2013, 09:49
Re: Shout command - by Lajko1 - 27.10.2013, 13:54

Forum Jump:


Users browsing this thread: 2 Guest(s)