Hey Community,
hier geht ein befehl nicht, kriege folgenden debug code.
[18:40:33] [debug] Run time error 4: "Array index out of bounds"
[18:40:33] [debug] Accessing element at index 18 past array upper bound 17
[18:40:33] [debug] Backtrace (most recent call first):
[18:40:33] [debug] #0 0037c3d0 in public ocmd_bizlist (playerid=0, params[]=@0x00000000 "") at D:\pRP\gamemodes\purerpscript_pub.pwn:38307
[18:40:33] [debug] #1 ???????? in native CallLocalFunction () from samp-server.exe
[18:40:33] [debug] #2 00008484 in public OnPlayerCommandText (playerid=0, cmdtext[]=@0x00000000 "") at D:\pRP\pawno\include\ocmd.inc:31
OCMD Include:
#include <a_samp>
#define ocmd:%1(%2) forward ocmd_%1(%2);\
public ocmd_%1(%2)
public OnPlayerCommandText(playerid,cmdtext[])
{
cmdtext[0]='_';
new ocmdStr[128],ocmdParams[128],bool:ocmdAffe,ocmdFu;
for(new i;i<128;i++)
{
if(cmdtext[i]=='\0')break;
if((cmdtext[i]==' ')&&(!ocmdAffe))
{
ocmdAffe=true;
continue;
}
if(!ocmdAffe)ocmdStr[i]=cmdtext[i];
else
{
ocmdParams[ocmdFu]=cmdtext[i];
ocmdFu++;
}
}
format(ocmdStr,128,"ocmd%s",ocmdStr);
if(!strlen(ocmdParams))format(ocmdParams,128," ");
if(CallLocalFunction(ocmdStr,"ds",playerid,ocmdParams))return 1; //error zeile
cmdtext[0]='/';
return CallLocalFunction("ocmd_OnPlayerCommandText","ds",playerid,cmdtext);
}
#if defined _ALS_OnPlayerCommandText
#undef OnPlayerCommandText
#else
#define _ALS_OnPlayerCommandText
#endif
#define OnPlayerCommandText ocmd_OnPlayerCommandText
forward ocmd_OnPlayerCommandText(playerid, cmdtext[]);
Script (befehl ausschnitt)
for (new i = 0; i < sizeof(BizInfo); i++)
{
format(string, sizeof(string), "%s\n%s [ %i/%i ]", string, BizName(i), BizInfo[i][biz_prods], bMaxProds[BizInfo[i][biz_art]-1][0]); //Error zeile (vermute -1)
}
ShowPlayerDialog(playerid, DIALOG_TRUCKER_BIZLIST, DIALOG_STYLE_LIST, "Bizliste", string, "Checkpoint", "Abbrechen");