It is currently Sun Oct 12, 2008 3:52 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: FindSubstance()
PostPosted: Thu Aug 31, 2006 3:47 am 
Offline

Joined: Wed Aug 30, 2006 5:24 pm
Posts: 82
Location: Italy
I have code:


Code:
    // Cerca materiale
    //
    if (consume_bottle)
      bottle := FindSubstance(who.backpack, UOBJ_EMPTY_BOTTLE, 1, 0);
      if (!bottle)
        SendSysMessage(who, "You run out of empty bottles.");
        break;
      endif
    endif

    // Consuma materiale
    //
    if (consume_bottle)
      if (!SubtractAmount(bottle, 1))
        SendSysMessage(who, "Can't consume empty bottles!!");
        break;
      endif
    endif



Why FindSubstance() do not fail while SubtractAmount(bottle, 1) fails?

It say me:
"Can't consume empty bottles!!"

_________________
Admin/Scripter Innominabile
ZuluHotelItalia shard on m4d


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 8:38 am 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 772
Location: Chicago, IL USA
are you possibly reserving the item anywhere? If so, SubtractAmount fails. If not, try setting SubtractAmount(bottle,1) to a variable and Print() or SendSysMessage() it to see the error.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 31, 2006 2:26 pm 
Offline

Joined: Wed Aug 30, 2006 5:24 pm
Posts: 82
Location: Italy
Uh... I have found the problem.... I think
FindSubstance() return an array :-))))

_________________
Admin/Scripter Innominabile
ZuluHotelItalia shard on m4d


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl