21.05.2018, 18:41
As the title says, here's the code
MAX_DROPPED_ITEMS is 500
MAX_INVENTORY is 15
(The code gets un neat when i pasted it)
Code:
if(dialogid == 10000) { if(response) { if(listitem == 0) { for(new i=0; i < MAX_DROPPED_ITEMS; i++) { if(DroppedItem[i][dItemAmount] == 0) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); DroppedItem[i][dItemX] = x; DroppedItem[i][dItemY] = y; DroppedItem[i][dItemZ] = z; GetPVarString(playerid, "SelectedItem", DroppedItem[i][dItemName], 32); for(new f=0; f < MAX_INVENTORY; f++) { if(!strcmp(DroppedItem[i][dItemName], PlayerInventory[playerid][f][pItemName])) { DroppedItem[i][dItemAmount] = PlayerInventory[playerid][f][pItemAmount]; PlayerInventory[playerid][f][pItemAmount] = 0; format(PlayerInventory[playerid][f][pItemName], 32, ""); new strings[64]; format(strings, 64, ""COL_LIGHTGREEN"Drop %s, Amount %d", DroppedItem[i][dItemName], DroppedItem[i][dItemAmount]); SendClientMessage(playerid, -1, strings); SaveDroppedItems(); return 1; } } return 1; } } } } }
MAX_INVENTORY is 15
(The code gets un neat when i pasted it)
Code:
[debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 50 past array upper bound 49 [debug] AMX backtrace: [debug] #0 000c7868 in ?? () from NOTGM.amx [debug] #1 00052000 in ?? (2, 10000, 1, 0, 29539412) from NOTGM.amx [debug] #2 0000f0f0 in public OnDialogResponse (2, 10000, 1, 0, 29539412) from NOTGM.amx