SA-MP Forums Archive
undefined symbil (.virtual) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: undefined symbil (.virtual) (/showthread.php?tid=603382)



undefined symbol (.virtual) - FinStar - 22.03.2016

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);



Re: undefined symbil (.virtual) - SyS - 22.03.2016

change .virtual to virtual


Re: undefined symbil (.virtual) - FinStar - 22.03.2016

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)



Re: undefined symbil (.virtual) - FinStar - 22.03.2016

Pleas, someone help ?


Re: undefined symbil (.virtual) - Sawalha - 22.03.2016

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;



Re: undefined symbil (.virtual) - Stuntff - 22.03.2016

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



Re: undefined symbil (.virtual) - FinStar - 22.03.2016

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

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

Line: 472 & 501


Re: undefined symbil (.virtual) - Stuntff - 22.03.2016

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


Re: undefined symbil (.virtual) - Sawalha - 22.03.2016

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


Re: undefined symbil (.virtual) - FinStar - 22.03.2016

Well, I'll try