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 Any function for getting if a cabinet's closed?
Equil Offline
Member

Posts: 94
Threads: 8
Joined: Sep 2010
Reputation: 0
#2
RE: Any function for getting if a cabinet's closed?

I just tested this with this script:

void OnStart() {

    SetEntityPlayerInteractCallback("cabinet_nice_1", "Cabinet", false);

}

void Cabinet(string &in asEntity) {

    if(GetSwingDoorState("cabinet_nice_1") == -1) {
    AddDebugMessage("CLOSED", false);
    }
    
    if(GetSwingDoorState("cabinet_nice_1") == 1) {
    AddDebugMessage("OPEN", false);
    }
    
}

I'm not really sure about this myself. But it seemed to work to an extent. I got both debug messages to appear when the cabinet was respectively open/closed. It also seems to work only when both is closed, the "CLOSED" message stopped appearing when I left one side open.
(This post was last modified: 03-17-2012, 12:18 PM by Equil.)
03-16-2012, 05:16 PM
Find


Messages In This Thread
RE: Any function for getting if a cabinet's closed? - by Equil - 03-16-2012, 05:16 PM



Users browsing this thread: 1 Guest(s)