Warum wird beim Aufrufen des Befehls, ein "Run time error" ausgelöst?
Code
[debug] Run time error 5: "Invalid memory access"
[debug] AMX backtrace:
[debug] #0 00009960 in public ocmd_inventory (playerid=0, params[]=@00052d84 " ") at ...\sampserver\pawno\include\modules\inventory\invInventory.inc:63
[debug] #1 native CallLocalFunction () from samp-server.exe
[debug] #2 000004c8 in public OnPlayerCommandText (playerid=0, cmdtext[]=@00052d58 "/inventory") at ...\sampserver\pawno\include\includes\ocmd.inc:78
[pwn=60]
ocmd:inventory(playerid, params[]) {
new str[256], frmt[496];
for(new i=0; i < MAX_PLAYER_ITEMS; i++) {
if(Items[i][itemBesitzerID] != PlayerAccount[playerid][playerDBID])continue;
format(frmt, sizeof(frmt), "%s%d. Item: %s (%d) | Amount: %d | Total Weight: %0.2f\n", frmt, i+1, /*Items[i][itemName]*/getItemName(Items[i][itemID]), Items[i][itemID], Items[i][itemAmount], (ItemList[Items[i][itemID]][itemlWeight]*Items[i][itemAmount]));
}
if(!strlen(frmt))return SendClientMessage(playerid, -1, "Es befinden sich keine Items in deinem Inventar.");
return SendClientMessage(playerid, -1, frmt);
}
[/pwn]