undefined symbil (.virtual)
#1

Hello, I have a little problem, does anyone know how to fix?

Код:
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);
Reply
#2

change .virtual to virtual
Reply
#3

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)
Reply
#4

Pleas, someone help ?
Reply
#5

as i see, you defined it in a code, then converted that code into a comment, which is:
pawn Код:
//new Float:x, Float:y, Float:z, Float:rx, Float: ry, Float:rz, Float:zoffset, world, interior, label, applyrotoffsets, virtual;
declare it as a normal pawn code so that pawn won't skip it during compiling; so it will be:
pawn Код:
new Float:x, Float:y, Float:z, Float:rx, Float: ry, Float:rz, Float:zoffset, world, interior, label, applyrotoffsets, virtual;
or, if you don't want to define all these variables with "virtual" variable, just do above the CreateItem code this:
pawn Код:
new virtual;
Reply
#6

try change
Код:
itemid = CreateItem(itemtype, .virtual = 1);
to
Код:
itemid = CreateItem(itemtype,1);
Reply
#7

Unfortunately, it must be ".virtual" Here I enclose an official open source code,

https://github.com/Southclaw/Scaveng.../save-load.pwn

Line: 472 & 501
Reply
#8

Quote:
Originally Posted by FinStar
Посмотреть сообщение
Unfortunately, it must be ".virtual" Here I enclose an official open source code,

https://github.com/Southclaw/Scaveng.../save-load.pwn

Line: 472 & 501
Just try
Reply
#9

CreateItem function doesn't even have a parameter called "virtual" as i see, maybe the guy who coded it meant "world" parameter, so instead of ".virtual = 1", try ".world = 1" and test it
Reply
#10

Well, I'll try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)