Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/04/01 16:40] claypigeon [The door] |
hpl2:tutorials:script:adding_messages_to_locked_doors [2012/04/01 16:44] claypigeon [The script] |
||
---|---|---|---|
Line 61: | Line 61: | ||
+ | <code c++> | ||
+ | |||
void DoorLockedPlayer(string &in entity) | void DoorLockedPlayer(string &in entity) | ||
- | + | ||
+ | |||
{ | { | ||
- | + | if(GetSwingDoorLocked("EXAMPLE_DOOR") == true) | |
- | + | { | |
- | SetMessage("Messages", "msgname", 0); | + | |
- | + | SetMessage("Messages", "msgname", 0); | |
+ | |||
+ | } | ||
} | } | ||
+ | </code> | ||
Line 77: | Line 81: | ||
void DoorLockedPlayer - this is the function that is called when the player interacts with the door (the one you've set in your level editor!) | void DoorLockedPlayer - this is the function that is called when the player interacts with the door (the one you've set in your level editor!) | ||
+ | |||
+ | |||
+ | GetSwingDoorLocked - We are checking wheter the doors is locked or not, so we won't get the message even when it's unlocked and interacted with. "EXAMPLE_DOOR" is the name of the door that we have given it earlier! | ||