A
/ \ _ Play Now Nemesis on
| | | | _______ _ _ _______ _______ _ _______
| |\ | | | ____| | \ / | | ____| / ____| | | / ____|
/-------/-------------------------------------------------------------------,
O= Home <=XX| About News Pics Adventurers Wizards Download Connect >
\-------\-------------------------------------------------------------------'
| | \ | | |____ | | | | | |____ ___ \ \ | | ___ \ \
| | \_| |_______| |_| |_| |_______| |_______/ |_| |_______/
\ /
V
Documentation Area
Document Path: /doc/efun/all_inventory
Name: all_inventory - get the inventory of an object
Syntax:
object *all_inventory(object ob)
Description:
The all_inventory efun gets the inventory of an object in form of
an array.
All_inventory returns only items on the 'first level' in the object,
if you want to search bags or chests too, you can use deep_inventory.
To make a for-loop to step through the inventory of an object it
is still faster using first_inventory() and next_inventory()
instead of all_inventory(), but not much.
Return value:
It returns an array of objects which are in the inventory of the
given object.
Examples:
Search the inventory of a player for a ring:
int i, len;
object *ob=all_inventory(this_player());
for (i=0, len=sizeof(ob); i<len; i++) {
if (ob[i]->id("ring")) {
write("Ring found!\n");
}
}
See also:
This page was generated in LPC
Imprint / Impressum