26.06.2018, 18:47
Not exactly sure why this is happening... Everything is correct..
pawn Код:
error 001: expected token: "]", but found "-identifier-"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
Functions.pwn(120) : fatal error 107: too many error messages on one line
pawn Код:
enum E_CHARACTER_INVENTORY
{
itemModel,
itemName[32],
itemQuantity,
itemData[248],
bool: itemExists,
bool: itemStackable,
}
new InventoryInformation[MAX_PLAYERS][MAX_INVENTORY_ITEMS][E_CHARACTER_INVENTORY];
pawn Код:
stock Inventory_Add(playerid, item[], model, bool:stackable, quantity = 1, data[])
{
new slot = Inventory_HasItem(playerid, item);
if(slot == -1)
{
slot = Inventory_GetFreeSlot(playerid);
if(slot != -1)
{
InventoryInformation[playerid][slot][itemExists] = true;
InventoryInformation[playerid][slot][itemStackable] = stackable;
InventoryInformation[playerid][slot][itemModel] = model;
InventoryInformation[playerid][slot][itemQuantity] = quantity;
// The issue is here
format(InventoryInformation[playerid][slot][itemName], sizeof(InventoryInformation[playerid][slot][itemName]), "%s", item);
format(InventoryInformation[playerid][slot][itemData], sizeof(InventoryInformation[playerid][slot][itemData]), "%s", data);
return slot;
}
return -1;
} else {
}
return slot;
}