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
If Statement
shiznit304 Offline
Junior Member

Posts: 4
Threads: 1
Joined: Oct 2010
Reputation: 0
#1
If Statement

How do I make an if statement to check if the door is not locked, then don't display message?
this is what I got.
if (GetSwingDoorLocked("door1") == true)
    {
        void AddMessage1(string &in entity)
        {
            AddDebugMessage("fgsfds",false);
            SetMessage("Messages", "ExitDoorMessage", 0);
        }    
}

But when i try to load my level, it says:
Unexpected token 'if'
10-10-2010, 09:13 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#2
RE: If Statement

Other way around.

void AddMessage1(string &in entity)
{
       if (GetSwingDoorLocked("door1") == true){
            AddDebugMessage("fgsfds",false);
            SetMessage("Messages", "ExitDoorMessage", 0);
        }    
}

10-10-2010, 09:21 PM
Find
shiznit304 Offline
Junior Member

Posts: 4
Threads: 1
Joined: Oct 2010
Reputation: 0
#3
RE: If Statement

Thanks. It works perfectly.
10-10-2010, 10:00 PM
Find




Users browsing this thread: 1 Guest(s)