palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
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 |
|