*changeinventory item amount issue

Forum Archive - from http://theuniversal.net
Locked
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

*changeinventory item amount issue

Post by morbydvisns »

Software:Universal Client
Version Number:
________________________________________________________________________
Location

________________________________________________________________________
Description:
Event( "&command","change")
{

*changeinventory %player% +10 brain power

$amountAdded = sysAddToInventory( "brain power" )
*updateinventory %player%
}
________________________________________________________________________
Steps to Replicate:
This only gives 1 brain power.

typing it in the world chat box gives 10.

And this doesn't work if the sysAddToInventory line isn't used, of which it only reports '1'

Maybe further explanation on how these work together is all that's needed.
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

shinola lol nvm my veh capacity was too low. Didnt even think about that =)
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

This brings another thing.. is there anyway sysAddToInventory can be used for more than just 1 unit of item at a time? Or a way to return a fault on not having enough inventory when you *changeinventory in script when inventory space isn't sufficient?
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

okeys, sysAddToInventory can now (server 0.66.0) accept an extra param for the quantity to add. The return value from the call is the number of the item actually added.

(Note that you don't need an *updateinventory call after using sysAddToInventory - the change is replicated out immediately to the targeted user. *updateinventory is only needed after *changeinventory which is intended to allow you to add multiple items to a player in a slightly more optimal way).
Locked