-
Notifications
You must be signed in to change notification settings - Fork 760
PC Search Inventory
Haru edited this page Oct 19, 2016
·
1 revision
int pc_search_inventory(struct map_session_data *sd,int item_id)
pc_search_inventory(target,ItemID)
- Target
- sd = user
- bl = target
- ItemID
- db/item_db.txt
if(pc_search_inventory(sd,501)>=10)
This will check if the character has 10 or more Red Potions(501) on his inventory.
It is important that you understand that *0* is a valid return value. Therefore, if you're searching for items it is best you do it similarly:
if ( (j = pc_search_inventory(sd, nameid)) >= 0 ) { etc; }