Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Ahdur

#1
Hi, I am simply trying to check if my character has a certain item in his inventory and, if so, continue with the game.
However, every time i try following the format in the manual : "bool Character.HasInventory(InventoryItem *item)" I am told that the variable of the character's name has already been imported or is already defined.
Please can somebody show me how to declare this boolean? Specifically I need to know what format I need to use to type in the name and inventory item assuming the character's name is cBob and the inventory item is iGold

Also, assuming I can get help with this, would it then be correct to enter:
if ((cBob.HasInventory(iGold)) == false)
 {
   [game code here]
 }

I have read and re-read the manual and scoured the forums but I cannot find any help.  This is all new to me so please have patience! I'm trying to teach myself basic coding principles at the same time as making the game but i'm sure the answer is simple because I cannot find the same question anywhere!

Anyway, thanks in advance!
SMF spam blocked by CleanTalk