SA-MP Forums Archive
Invalid Command Length (Exceeding 50 characters) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Invalid Command Length (Exceeding 50 characters) (/showthread.php?tid=196152)



Invalid Command Length (Exceeding 50 characters) - NewYorkRP - 04.12.2010

How can i remove, or atleast boost this up? it's so irritating!!

this is my code:

pawn Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
                return 1;
            }
            if((noooc) && PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_GREY, "   The OOC channel has been disabled by an Admin !");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[160];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/o)oc [ooc chat]");
                return 1;
            }
            format(string, sizeof(string), "(( %s: %s ))", sendername, result);
            OOCOff(COLOR_OOC,string);
        }
        return 1;
    }



Re: Invalid Command Length (Exceeding 50 characters) - BloodyEric - 04.12.2010

Wait, you did

/thisisacommandthathas50charactersorevenmore

and worry about it?


Re: Invalid Command Length (Exceeding 50 characters) - NewYorkRP - 04.12.2010

Hey smart ass, i have a command, like many other roleplay servers;

/o [text] ..

And when i type it's fucking annoying as it's so small.


Re: Invalid Command Length (Exceeding 50 characters) - WillyP - 04.12.2010

Quote:
Originally Posted by NewYorkRP
Посмотреть сообщение
Hey smart ass, i have a command, like many other roleplay servers;

/o [text] ..

And when i type it's fucking annoying as it's so small.
He wasn't being a smart-ass, he was re-inacting what you may be talking about.


Re: Invalid Command Length (Exceeding 50 characters) - NewYorkRP - 04.12.2010

i still need help ffs


Re: Invalid Command Length (Exceeding 50 characters) - Biesmen - 04.12.2010

Quote:
Originally Posted by NewYorkRP
Посмотреть сообщение
i still need help ffs
With that attitude no one will help you.

I never had or have this problem with a command, please copy and paste the command.


Re: Invalid Command Length (Exceeding 50 characters) - NewYorkRP - 04.12.2010

it's the new 0.3c which messed it up -.-


Re: Invalid Command Length (Exceeding 50 characters) - Hal - 04.12.2010

Quote:
Originally Posted by NewYorkRP
Посмотреть сообщение
it's the new 0.3c which messed it up -.-
if its an /o OOC chat command, use command parameters.


Re: Invalid Command Length (Exceeding 50 characters) - RyDeR` - 04.12.2010

If you're using strtok make sure the result length is increased.


Re: Invalid Command Length (Exceeding 50 characters) - NewYorkRP - 05.12.2010

This is my command:

pawn Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
                return 1;
            }
            if((noooc) && PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_GREY, "   The OOC channel has been disabled by an Admin !");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[160];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/o)oc [ooc chat]");
                return 1;
            }
            format(string, sizeof(string), "(( %s: %s ))", sendername, result);
            OOCOff(COLOR_OOC,string);
        }
        return 1;
    }
When i type /o [message], it pops up after half way, saying that i exceeded 50 characters .