Home   Help Search Login Register  

Author Topic: height 0  (Read 1301 times)

0 Members and 1 Guest are viewing this topic.

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
height 0
« on: 15 Mar 2011, 04:22:35 »
I want to make a script that when a chopper has height 0, get a radio message or a titletext or anything.
How Can I do that?
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: height 0
« Reply #1 on: 15 Mar 2011, 06:29:53 »
helicopter name  = heli1


script.sqs

Code: [Select]

#loopy
~1
? (getpos heli1 select 2) > 0 : goto "Loopy"

~2
titleText ["The chopper is successfully landed!", "PLAIN"]
player sideChat "We have landed the choppa right here! Yay!"

By using the above script, you can only use it for the helicopter named heli1.
A message and a titletext will appear when it is at or below height 0.

And it is NOT sea level, just the ground level right below the helicopter.
(For see level, a gamelogic might be needed)




snippet.sqs
Code: [Select]
_heli = _this select 0
_hei = _this select 1
_delay = _this select 2
_code = _this select 3

#Loop
~1
? (getpos _heli select 2) > _hei : goto "Loop"

~_delay
call _code
exit


With this one, you can check for any helicopter or even other vehicles.
Format :
Code: [Select]
[ heliname, height, delay, code ] exec "snippet.sqs"
Sample :
Code: [Select]
[ heli1, 0, 3, {player sideChat "Yay we are at 0 height!"}] exec "snippet.sqs"
Script will display radio message 3 s after heli1 has reached height 0.

Always enclose code with { and }
Examples : { man1 moveingunner heli1 } / { chopLanded = TRUE } / {hint "Choppa is landed"}

Hope this helps pal.

Regards,
Haroon1992
« Last Edit: 15 Mar 2011, 06:36:08 by haroon1992 »
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Re: height 0
« Reply #2 on: 15 Mar 2011, 23:25:24 »
Hi haroon1992,

I've tested your examples, and I've got to say that are good, Now I can to put a message when the chopper have got an height of 0

Cheers,
Aldo15
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom