22.03.2016, 17:15
Still, problem.
Код:
/* Inventory */ length = modio_read(filename, _T<I,N,V,0>, sizeof(saveload_ItemList), saveload_ItemList); itemlist = ExtractItemList(saveload_ItemList, length); d:2:HANDLER("[LOAD:%p] Inv items: %d", playerid, GetItemListItemCount(itemlist)); for(new i, j = GetItemListItemCount(itemlist); i < j; i++) { itemtype = GetItemListItem(itemlist, i); if(length == 0) break; if(itemtype == INVALID_ITEM_TYPE) break; if(itemtype == ItemType:0) break; //new Float:x, Float:y, Float:z, Float:rx, Float: ry, Float:rz, Float:zoffset, world, interior, label, applyrotoffsets, virtual; itemid = CreateItem(itemtype, virtual = 1); //itemid = CreateItem(itemtype, Float:x = 0.0, Float:y = 0.0, Float:z = 0.0, Float:rx = 1000.0, Float:ry = 1000.0, Float:rz = 1000.0, Float:zoffset = 0.0, world = 0, interior = 0, label = 1, applyrotoffsets = 1, virtual = 1) if(!IsItemTypeSafebox(itemtype) && !IsItemTypeBag(itemtype)) SetItemArrayDataFromListItem(itemid, itemlist, i); AddItemToInventory(playerid, itemid, 0); d:3:HANDLER("[LOAD:%p] - Inv item %d: %d", playerid, i, _:itemtype); } DestroyItemList(itemlist);
Код:
stock CreateItem(ItemType:type, Float:x = 0.0, Float:y = 0.0, Float:z = 0.0, Float:rx = 1000.0, Float:ry = 1000.0, Float:rz = 1000.0, Float:zoffset = 0.0, world = 0, interior = 0, label = 1, applyrotoffsets = 1)