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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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