The Dink Network

Reply to Re: item_check

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
January 17th 2007, 03:21 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
From DinkC.chm (in the \develop subfolder of where you have Dink installed)

count_item
Category: Inventory, Script
Version: 1.00+
Prototype: int count_item(string script[9]);

count_item counts the number of items with the script script in the weapon/item inventory. Interestingly, the specified script need not actually exist: it only has to be the same as the corresponding add_item command's script-name argument.


For example:

void main( void )
{
int &nuts = count_item("item-nut");
if (&nuts == 0)
{
say_stop("I don't have any nuts!",1);
return;
}
say_stop("I have &nuts nuts!",1);
}