The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help [SOLVED] Checking for multiple items
Pshyched Offline
Member

Posts: 130
Threads: 21
Joined: Nov 2012
Reputation: 5
#1
[SOLVED] Checking for multiple items

I am trying to code a way to check for multiple items. The obvious way is not working so Im hoping someone may know a way to check for multiple items before finishing it.

Is there an If / Then / Else function within the HPL2 engine script anyway, if so it would make things easier..

I basically want them to try the key, if the player has not got the other keys in their inventory then it just pops up a message saying "I should grab those keys before I leave" and then does nothing else. Once the player has the keys, it does the normal action that I already coded.

Spoiler below!
    void LeavingHouse(string &in asItem, string &in asEntity)
    {
        if(HasItem("BarricadeLockKey")==true)
        and
        if(HasItem("CarterIslandEntranceKey")==true)
        
        {
            SetLevelDoorLocked("HouseDoor", false);
            PlaySoundAtEntity("", "unlock_door", "HouseDoor", 0, false);
            CompleteQuest("LeaveHouse","LeaveHouse");
        }
    }

(This post was last modified: 04-25-2014, 05:52 PM by Pshyched.)
04-25-2014, 04:35 PM
Find


Messages In This Thread
[SOLVED] Checking for multiple items - by Pshyched - 04-25-2014, 04:35 PM
RE: Checking for multiple items - by Mudbill - 04-25-2014, 05:13 PM
RE: Checking for multiple items - by Pshyched - 04-25-2014, 05:39 PM



Users browsing this thread: 1 Guest(s)