player/save-load.pwn(472) : error 017: undefined symbol "virtual" player/save-load.pwn(472) : warning 215: expression has no effect player/save-load.pwn(472) : error 001: expected token: ";", but found ")" player/save-load.pwn(472) : error 029: invalid expression, assumed zero player/save-load.pwn(472) : fatal error 107: too many error messages on one line
/* 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; itemid = CreateItem(itemtype, .virtual = 1); This line. 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);
/* 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)
//new Float:x, Float:y, Float:z, Float:rx, Float: ry, Float:rz, Float:zoffset, world, interior, label, applyrotoffsets, virtual;
new Float:x, Float:y, Float:z, Float:rx, Float: ry, Float:rz, Float:zoffset, world, interior, label, applyrotoffsets, virtual;
new virtual;
itemid = CreateItem(itemtype, .virtual = 1);
itemid = CreateItem(itemtype,1);
Unfortunately, it must be ".virtual" Here I enclose an official open source code,
https://github.com/Southclaw/Scaveng.../save-load.pwn Line: 472 & 501 |