Home   Help Search Login Register  

Author Topic: CTF script problem  (Read 1157 times)

0 Members and 1 Guest are viewing this topic.

CopyrightPhilly

  • Guest
CTF script problem
« on: 02 May 2005, 17:12:26 »
My Problem:
When a player who has the flag dies and the flag gets returned (think its sound2) keeps looping over and over (rapid speed) untill the flag is taking from the post again.

My code:
Code: [Select]
wflag setflagtexture "flags\west.jpg"
wflag setflagside west
wflag setflagowner objNull

#start
@!(isnull flagowner wflag)
_owner = (flagowner wflag)
_name = name _owner
_owner addScore 1

titletext[format["%1 has taking the west flag",_name],"PLAIN DOWN"]
playSound "sound1"

#loop
_d = eflag distance (flagowner wflag)
?!(alive _owner): goto "drop"
?(_d <= 5) && (isnull flagowner eflag): goto "score"
~0.001
goto "loop"

#drop
titletext[format["%1 has droped the west flag",_name],"PLAIN DOWN"]
_i = 0

#drop_wait
?(flagowner wflag) != _owner: goto "drop_picked_up"
?_i >= 50:goto "drop_return"
_i = _i + 1
~0.1
goto "drop_wait"

#drop_picked_up
_owner = (flagowner wflag)
_name = name _owner
titletext[format["%1 has picked up the west flag",_name],"PLAIN DOWN"]
playSound "sound1"
~0.001
goto "loop"

#drop_return
wflag setflagTexture "flags\west.jpg"
wflag setflagSide west
wflag setflagowner objNull
titletext[format["West flag was returned"],"PLAIN DOWN"]
goto "start"

#score
?(local server): escore = escore + 1; publicvariable "eScore"
wflag setflagTexture "flags\west.jpg"
wflag setflagSide west
wflag setflagowner objNull
titletext[format["East captured the west flag"],"PLAIN DOWN"]
playSound "sound2"
_owner addScore 4
[] exec "misc\stats.sqs"
goto "start"