Invalid Command Lenght - Max_Coldheart - 01.08.2011
Well, I am working on my friends RP script.
There has suddently appeared an problem. Once you type any command, (over 50 characters) they get the error: "Invalid command length (exceeded 50 characters)", but that is nowhere in the script, how to fix this?
(It uses strcmp)
Re: Invalid Command Lenght - Max_Coldheart - 02.08.2011
Bumping
AW: Invalid Command Lenght -
samtey - 02.08.2011
Try ur command with ZCMD:
pawn Код:
CMD:yourcmd (playerid, params[])
// your command!
Re: Invalid Command Lenght - Max_Coldheart - 02.08.2011
but zcmd disables strcmp, so I would have to redo all the commands.
I simply do not have nerves to do that, any other solutions to this?
Re: Invalid Command Lenght -
Kush - 02.08.2011
You have a 50 character command? so an example would be:
PHP код:
CMD:qwertyuiopasdfghjkklzxmasdfghqwertuyizxncmvs1239j(playerid, params[])
{
return 1;
}
Post the code O_O...
Re: Invalid Command Lenght - Max_Coldheart - 02.08.2011
No, I do not have any command that long.
I mean, when I try to type anything (for example: /me (and the params go over 50 characters) I get the error "Invalid command length (exceeded 50 characters)", but I already searched the script, there is nowhere in the whole script anything that would trigger this, I do not have even that message in my script, so could this be caused by SA:MP itself? (server is hosted on server FFS)
Re: Invalid Command Lenght -
Kush - 02.08.2011
Invalid parameter count. Show the code.
Re: Invalid Command Lenght - Max_Coldheart - 02.08.2011
There is ~3 command that keep doing it (Dont know about other commands)
pawn Код:
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[96];
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: /me [action]");
return 1;
}
if(PlayerInfo[playerid][pMask] == 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);
}
return 1;
}
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;
}
new atext[60];
if(PlayerInfo[playerid][pAdmin] == 0){ atext = ""; }
if(PlayerInfo[playerid][pAdmin] == 1){ atext = ""; }
if(PlayerInfo[playerid][pAdmin] == 2){ atext = "Junior Admin"; }
if(PlayerInfo[playerid][pAdmin] == 3){ atext = "General Admin"; }
if(PlayerInfo[playerid][pAdmin] == 4){ atext = "Senior Admin"; }
if(PlayerInfo[playerid][pAdmin] == 1337){ atext = "Head Admin"; }
if(PlayerInfo[playerid][pAdmin] == 99998){ atext = "Server Scripter"; }
if(PlayerInfo[playerid][pAdmin] == 99999){ atext = "Server Manager"; }
if(PlayerInfo[playerid][pAdmin] == 100000){ atext = "Community Owner"; }
format(string, sizeof(string), "(( %s %s: %s ))", atext, sendername, result);
OOCOff(COLOR_OOC,string);
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/b", 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[96];
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: /b [local ooc chat]");
return 1;
}
if(PlayerInfo[playerid][pMask] == 1)
{
format(string, sizeof(string), "Stranger: (( %s ))", result);
}
else
{
format(string, sizeof(string), "%s: (( %s ))", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
return 1;
}
Re: Invalid Command Lenght -
XpanD - 04.08.2011
Quote:
Originally Posted by Max_Coldheart
No, I do not have any command that long.
I mean, when I try to type anything (for example: /me (and the params go over 50 characters) I get the error "Invalid command length (exceeded 50 characters)", but I already searched the script, there is nowhere in the whole script anything that would trigger this, I do not have even that message in my script, so could this be caused by SA:MP itself? (server is hosted on server FFS)
|
That.
Anyways, let's just wait for a reply from his side and not derail the topic too much.
AW: Re: Invalid Command Lenght -
samtey - 04.08.2011
Quote:
Originally Posted by Max_Coldheart
There is ~3 command that keep doing it (Dont know about other commands)
pawn Код:
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[96]; 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: /me [action]"); return 1; } if(PlayerInfo[playerid][pMask] == 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); } return 1; }
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; } new atext[60]; if(PlayerInfo[playerid][pAdmin] == 0){ atext = ""; } if(PlayerInfo[playerid][pAdmin] == 1){ atext = ""; } if(PlayerInfo[playerid][pAdmin] == 2){ atext = "Junior Admin"; } if(PlayerInfo[playerid][pAdmin] == 3){ atext = "General Admin"; } if(PlayerInfo[playerid][pAdmin] == 4){ atext = "Senior Admin"; } if(PlayerInfo[playerid][pAdmin] == 1337){ atext = "Head Admin"; } if(PlayerInfo[playerid][pAdmin] == 99998){ atext = "Server Scripter"; } if(PlayerInfo[playerid][pAdmin] == 99999){ atext = "Server Manager"; } if(PlayerInfo[playerid][pAdmin] == 100000){ atext = "Community Owner"; } format(string, sizeof(string), "(( %s %s: %s ))", atext, sendername, result); OOCOff(COLOR_OOC,string); } return 1; }
pawn Код:
if(strcmp(cmd, "/b", 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[96]; 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: /b [local ooc chat]"); return 1; } if(PlayerInfo[playerid][pMask] == 1) { format(string, sizeof(string), "Stranger: (( %s ))", result); } else { format(string, sizeof(string), "%s: (( %s ))", sendername, result); } ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); } return 1; }
|
Sorry, but I only see format(sizeof str) blah, blah! Where the hell is the:
I told u?