Home   Help Search Login Register  

Author Topic: 60 seconds until death  (Read 606 times)

0 Members and 1 Guest are viewing this topic.

Offline FiLL2d

  • Members
  • *
  • X.x
60 seconds until death
« on: 30 Nov 2004, 21:15:41 »
ok, im making a script where if you go into the radius of 800m, you die within 60 seconds... but, if you go back out of the radius the time stops and if you go back into the radius it starts back on 60... ok i hope that made sense.

----------------------die2.sqs
_unit = _this select 0

#check1
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1"
? (p2 == Player) AND (p2 distance columbia < 800) : Goto "startciv2"
? (p3 == Player) AND (p3 distance columbia < 800) : Goto "startciv3"
? (p4 == Player) AND (p4 distance columbia < 800) : Goto "startciv4"
? (p5 == Player) AND (p5 distance columbia < 800) : Goto "startciv5"

#startciv1

_msg=Format["You have got 60 seconds left on Columbia before you die"]
? (p1 == Player) : p1 groupChat _msg

~10
? (p1 == Player) AND (p1 distance columbia > 800) : Goto "startcivsaved"
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1_1"


#startciv1_1

_msg=Format["You have got 50 seconds left on Columbia before you die"]
? (p1 == Player) : p1 groupChat _msg

~10
? (p1 == Player) AND (p1 distance columbia > 800) : Goto "startcivsaved"
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1_2"

#start1_2

_msg=Format["You have got 40 seconds left on Columbia before you die"]
? (p1 == Player) : p1 groupChat _msg

~10
? (p1 == Player) AND (p1 distance columbia > 800) : Goto "startcivsaved"
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1_3"

#startciv1_3

_msg=Format["You have got 30 seconds left on Columbia before you die"]
? (p1 == Player) : p1 groupChat _msg

~10
? (p1 == Player) AND (p1 distance columbia > 800) : Goto "startcivsaved"
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1_4"

#startciv1_4

_msg=Format["You have got 20 seconds left on Columbia before you die"]
? (p1 == Player) : p1 groupChat _msg

~10
? (p1 == Player) AND (p1 distance columbia > 800) : Goto "startcivsaved"
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1_5"

#startciv1_5

_msg=Format["You have got 10 seconds left on Columbia before you die"]
? (p1 == Player) : p1 groupChat _msg

~10
? (p1 == Player) AND (p1 distance columbia > 800) : Goto "startcivsaved"
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startcivdeath"

#startcivdeath


? (p1 == Player) : Goto "death1"
? (p2 == Player) : Goto "death2"
? (p3 == Player) : Goto "death3"
? (p4 == Player) : Goto "death4"
? (p5 == Player) : Goto "death5"

#death1

p1 setdamage 1

#death2

p2 setdamage 1

#death3

p3 setdamage 1

#death4

p4 setdamage 1

#death5

p5 setdamage 1

#startcivsaved

? (p1 == Player) : Goto "save1"
? (p2 == Player) : Goto "save2"
? (p3 == Player) : Goto "save3"
? (p4 == Player) : Goto "save4"
? (p5 == Player) : Goto "save5"

#save1
_msg=Format["You left Columbia and the 60 second count stopped"]
? (p1 == Player) : p1 groupChat _msg
#save2
_msg=Format["You left Columbia and the 60 second count stopped"]
? (p2 == Player) : p2 groupChat _msg
#save3
_msg=Format["You left Columbia and the 60 second count stopped"]
? (p3 == Player) : p3 groupChat _msg
#save4
_msg=Format["You left Columbia and the 60 second count stopped"]
? (p4 == Player) : p4 groupChat _msg
#save5
_msg=Format["You left Columbia and the 60 second count stopped"]
? (p5 == Player) : p5 groupChat _msg
----------------die2.sqs

ok i just updated the script, my problem now is that it doesnt go past 50 seconds, can someone tell me what is going wrong... is it the _msg

note, i've only made startciv1, not the other 4
« Last Edit: 30 Nov 2004, 21:26:29 by FiLL2d »

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:60 seconds until death
« Reply #1 on: 30 Nov 2004, 23:20:58 »
Code: [Select]
? (p1 == Player) AND (p1 distance columbia > 800) : Goto "startcivsaved"
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1_2"

#start1_2
~


I think you made a typo here...

Or Goto"start1_2,or #startciv1_2  is correct :)
http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:60 seconds until death
« Reply #2 on: 01 Dec 2004, 05:27:15 »
i see a few things that don't make sense to me:
1) When you start in the safe zone, it will send you a message that you left the kill zone before your time was up, but the countdown never even started...

2)
Code: [Select]
#startcivdeath


? (p1 == Player) : Goto "death1"
? (p2 == Player) : Goto "death2"
? (p3 == Player) : Goto "death3"
? (p4 == Player) : Goto "death4"
? (p5 == Player) : Goto "death5"

#death1

p1 setdamage 1

#death2

p2 setdamage 1

#death3

p3 setdamage 1

#death4

p4 setdamage 1

#death5

p5 setdamage 1

#startcivsaved

? (p1 == Player) : Goto "save1"
? (p2 == Player) : Goto "save2"
? (p3 == Player) : Goto "save3"
? (p4 == Player) : Goto "save4"
? (p5 == Player) : Goto "save5"
with that, if the player who leaves happens to be p1, you're going to kill off all the others along with him.
you need to put a goto command there so it won't kill all of them
3) in reference to the same section as above, even if you kill the player, it will still tell him he got out in time
4)you never exit the script (the exit command)
5)
Code: [Select]
#check1
? (p1 == Player) AND (p1 distance columbia < 800) : Goto "startciv1"
? (p2 == Player) AND (p2 distance columbia < 800) : Goto "startciv2"
? (p3 == Player) AND (p3 distance columbia < 800) : Goto "startciv3"
? (p4 == Player) AND (p4 distance columbia < 800) : Goto "startciv4"
? (p5 == Player) AND (p5 distance columbia < 800) : Goto "startciv5"
there are no startciv2, startciv3, startciv4, or startciv5 labels in your script
6)you never use the varible _unit that you are calling the script with

thats all for now, its bedtime

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:60 seconds until death
« Reply #3 on: 01 Dec 2004, 07:58:33 »
Why don't you just use a trigger radius 800; time 60.  But change the time mode from its default setting.  One of them is CountDown and the other is TimeOut.  I can't remember which is the default - I just remember what they do.

In the default mode activating the trigger will cause whatever is in the action field to occur after the specified time come what may.  But the other mode will do exactly what you want, it will stop counting once the conditions of the trigger cease to be met and will restart the clock again at the beggining once the conditions are met again.  Only when it reaches the specified time does it action whatever is in the activation field.
« Last Edit: 04 Dec 2004, 09:23:08 by THobson »