Doors
Posted: 13 Jun 2012, 15:46
Hello Guys...
I want to make a door in a multi-player map that opens only for players who have 10,000 points or more, but I have some problems...
Here's what I tried:
The door opens for the first time, and then it doesn't open again? Any ideas?
I want to make a door in a multi-player map that opens only for players who have 10,000 points or more, but I have some problems...
Here's what I tried:
Code: Select all
// Door Data
DOOR_DATA sg_door = SINGLE (11, 5, 2) (11.0, 6.0, 2.0, 1.0, 1.0)
BOTTOM 0 ANY_PLAYER CLOSE_WHEN_OPEN_RULE_FAILS 0 NOT_FLIPPED NOT_REVERSED
MAKE_DOOR_MANUAL(sg_door)
// Subroutines For The Door
sg_opendoor_Pa:
IF(CHECK_SCORE_GREATER(Pa, 9999))
ADD_SCORE(Pa, -10000)
UPDATE_DOOR_TARGET(sg_door, Pa)
MAKE_DOOR_AUTOMATIC(sg_door)
ENDIF
RETURN
sg_opendoor_Pb:
IF(CHECK_SCORE_GREATER(Pb, 9999))
ADD_SCORE(Pb, -10000)
UPDATE_DOOR_TARGET(sg_door, Pb)
MAKE_DOOR_AUTOMATIC
ENDIF
RETURN
sg_closedoorbehind:
CLOSE_DOOR(sg_door)
RETURN
// Thread Triggers For The Door
THREAD_TRIGGER sg_waitdooropen_Pa = THREAD_WAIT_FOR_CHAR_IN_BLOCK
(Pa, 11, 6, 2, sg_opendoor_Pa:)
THREAD_TRIGGER sg_waitdooropen_Pb = THREAD_WAIT_FOR_CHAR_IN_BLOCK
(Pb, 11, 6, 2, sg_opendoor_Pb:)
THREAD_TRIGGER sg_waitdoorclose_Pa = THREAD_WAIT_FOR_CHAR_IN_BLOCK
(Pa, 11, 4, 2, sg_closedoorbehind:)
THREAD_TRIGGER sg_waitdoorclose_Pb = THREAD_WAIT_FOR_CHAR_IN_BLOCK
(Pb, 11, 4, 2, sg_closedoorbehind:)
ENABLE_THREAD_TRIGGER(sg_waitdooropen_Pa)
ENABLE_THREAD_TRIGGER(sg_waitdooropen_Pb)
ENABLE_THREAD_TRIGGER(sg_waitdoorclose_Pa)
ENABLE_THREAD_TRIGGER(sg_waitdoorclose_Pb)