ZCMD Crashdetect error
#1

Hi,
If I write a command long than 32 characters, crashdetect shows me:
Код:
[23:04:06]
[23:04:18] [debug] Run time error 4: "Array index out of bounds"
[23:04:18] [debug]  Accessing element at index 32 past array upper bound 31
[23:04:18] [debug] AMX backtrace:
[23:04:18] [debug] #0 00009f30 in public OnPlayerCommandText (playerid=7, cmdtext[]=@0x0134c7c8 "/sarkihttp://www.youtube.com/watch?...") at C:\....\include\zcmd.inc:94
This happens on doesn't exist commands and returns "Server: Unknown Command", normally it should return SendClientMessage(playerid,-1,"Wrong command!");
Reply
#2

You are trying to use strcmp and zcmd both the commands.
Convert your command to a single type.
ZCMD or strcmp, i prefer you to change it to zcmd.
Reply
#3

Quote:
Originally Posted by Avi Raj
Посмотреть сообщение
You are trying to use strcmp and zcmd both the commands.
Convert your command to a single type.
ZCMD or strcmp, i prefer you to change it to zcmd.
No, I don't have any strcmp commands. All my commands are ZCMD. But I have anti dialog and anti changing name hack in OnPlayerCommandReceived. It causes ?
Reply
#4

show your OnPlayerCommandText
Reply
#5

Quote:
Originally Posted by Avi Raj
Посмотреть сообщение
show your OnPlayerCommandText
I don't have OnPlayerCommandText. I have changed it OnPlayerCommandReceived.
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
new ID = GetPlayerDialogID(playerid);
if(ID != -1) return SendClientMessage(playerid,COLOR_ADMIN,"Dialog Hack!"),Kickit(playerid);
return 1;
}
Reply
#6

Quote:
Originally Posted by blackeagle1122
Посмотреть сообщение
Hi,
If I write a command long than 32 characters, crashdetect shows me:
ZCMD passes a callback as command. And callbacks don't support more than 32 characters. Only parameters would be supporting. If that's not the case, show your codes here in relating to that cmd.
Reply
#7

zcmd command limit is 32 characters! That means you cant call command that is longer than 32 characters. You can fix it, just open zcmd.inc file find line called:
pawn Код:
#define MAX_FUNC_NAME (32)
And replace it with longer value like:
pawn Код:
#define MAX_FUNC_NAME (64)
But im not sure that will work.

edit: i'm too slow...
Reply
#8

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
ZCMD passes a callback as command. And callbacks don't support more than 32 characters. Only parameters would be supporting. If that's not the case, show your codes here in relating to that cmd.
That happens on doesn't exist commands.
Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
zcmd command limit is 32 characters! That means you cant call command that is longer than 32 characters. You can fix it, just open zcmd.inc file find line called:
pawn Код:
#define MAX_FUNC_NAME (32)
And replace it with longer value like:
pawn Код:
#define MAX_FUNC_NAME (64)
But im not sure that will work.

edit: i'm too slow...
Solved thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)