OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Tim Pink on 14 Jun 2003, 13:08:15
-
Hi everyone
ok i have a problem with a certain thing called an eventhandler ??? ???
ok i have a helicopter with waypoints to an extraction but i want one of the waypoints to be synched with a trigger that will only activate when you throw a smokeshell at the LZ
ive thought about using it so that when the triggers realizes that the shell has been thrown it sets the choppers fuel to full(but thats a bit beyond me)
and if anyone can answer this : how do i make the chopper come to wherever the player is after the smokeshell is thrown?
Thanx
-
Hey Tim,
An event handler is something that activates when a certain Event happens. To get what you're after, you'll want to use a "Fired" event handler.
In the player's init line, type:
smokin = false; this addEventHandler ["Fired",{if (_this select 4 == "Smokeshell") then {smokin = true}}]
The first part sets the variable smokin to false. We'll use this to get your chopper moving.
The next part adds the event handler. What happens, is everytime the player fires a shot (or throws a smokeshell), the line:
{if (_this select 4 == "Smokeshell") then {smokin = true}}
is actiavated. So it checks to see if the player has thrown smoke, and if so makes smokin true.
So if you sync a trigger to your chopper's waypoint, and make the condition: smokin, then the chopper will move after the player has thrown a smokeshell.
To change the colour of the smoke, simply change "smokeshell" to "smokeshellred" or "smokeshellgreen".
Hope that helps you out ;)
-
Thank you Sui
U r the messiah
;D ;D ;D
-
i answered similar Q som time ago - y ppl dont search nymore >:( ;D
U r the messiah
not exactly :P meezy (http://www.ofpec.com/yabbse/index.php?board=27;action=viewprofile;user=Messiah) is da messiah ;) ;D
sui is on higher stage ;D (n me to :P :-* 8))
LCD OUT
-
lol.... cheeky git ::)
-
i hearby from this moment on refer to messiah as messiah 1, sui as messiah messiah and LCD as the giant bouncing orange from Constantinople
hehehehe
thanx for all your help
-
* da orange opens its eyes nd looks around
pink isnt it ? da big jumpin pink guiava from mesechosts :wow: (waz dat name ???)]
got sucide intentions dont u ? got da whole EC coverin ma back :P ;) - b aware from snipers on da roof across da st. dey waitin :P
LCD OUT
P.S solve da topic ;) :P
-
and get LCD his medication while ur at it ::)
-
baah
no need 2 - i got my medication right here on ma comp table :P - just cant find wat da name of da pills seems like da 1st leter is L n sec 1 is S ny ideas ??? ::)
LCD OUT
[edit] P.S - mezzy u c dat sniper dere ? ::) :o