Jump to content
  • 0
bWolfie

Check item type in source

Question

Hello,

I'm trying to make a plugin which will automatically store an item by type. I'm testing at the moment with IT_ETC but I can't get it to work.

How to correctly check item type?
Thanks

struct item_data* id;
for (i = 0; i < MAX_INVENTORY; i++)
{
	id = 0;
	if (sd->status.inventory[i].amount)
	{
		id = itemdb_type(sd->status.inventory[i].nameid);
		if (id && id->type == IT_ETC)
			storage->add(sd, i, sd->status.inventory[i].amount);
	}
}

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.