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 If statement + locked door
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: If statement + locked door

My guess is that your parameters for the function to run upon the player interacting with the door are incorrect. Is the interaction scripted using SetEntityPlayerInteractCallback() or using SetEntityCallbackFunc()? The parameters are different for each interaction. The first uses a single parameter, the entity name, while the second uses two -- the entity name and the type of interaction.

When checking for truth or falsehood, you don't need to assert that your Boolean value equals true or false. You can simply use



if(GetSwingDoorLocked("cellar_wood01_3") && GetPropIsInteractedWith("cellar_wood01_3")) // code here


Also, you are correct -- there isn't any need to check if the prop is interacted with. Since the function is run when the player interacts with the door, GetPropIsInteractedWith will always be true.

03-21-2012, 12:02 AM
Find


Messages In This Thread
If statement + locked door - by DaAinGame - 03-20-2012, 10:44 PM
RE: If statement + locked door - by palistov - 03-21-2012, 12:02 AM
RE: If statement + locked door - by DaAinGame - 03-21-2012, 12:26 AM



Users browsing this thread: 1 Guest(s)