Home   Help Search Login Register  

Author Topic: Eventhandlers for sui  (Read 634 times)

0 Members and 1 Guest are viewing this topic.

Offline Tim Pink

  • ECP Team &
  • Former Staff
  • ****
  • "Down with a bang and that'll be the end"
Eventhandlers for sui
« 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



« Last Edit: 14 Jun 2003, 13:17:21 by Timothy Pink »
"Whoever said nothing is impossible, never tried slamming a revolving door."

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Eventhandlers for sui
« Reply #1 on: 14 Jun 2003, 13:28:48 »
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 ;)

Offline Tim Pink

  • ECP Team &
  • Former Staff
  • ****
  • "Down with a bang and that'll be the end"
Re:Eventhandlers for sui
« Reply #2 on: 14 Jun 2003, 13:39:13 »
Thank you Sui

U r the messiah

 ;D ;D ;D
"Whoever said nothing is impossible, never tried slamming a revolving door."

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Eventhandlers for sui
« Reply #3 on: 14 Jun 2003, 13:50:01 »
i answered similar Q som time ago - y ppl dont search nymore  >:(  ;D

Quote
U r the messiah

not exactly :P meezy is da messiah ;) ;D

sui is on higher stage ;D (n me to  :P  :-*  8))

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Eventhandlers for sui
« Reply #4 on: 14 Jun 2003, 17:30:04 »
lol.... cheeky git  ::)
Proud Member of the Volunteer Commando Battalion

Offline Tim Pink

  • ECP Team &
  • Former Staff
  • ****
  • "Down with a bang and that'll be the end"
Re:Eventhandlers for sui
« Reply #5 on: 15 Jun 2003, 13:26:28 »
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
"Whoever said nothing is impossible, never tried slamming a revolving door."

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Eventhandlers for sui
« Reply #6 on: 15 Jun 2003, 13:36:18 »
* 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
« Last Edit: 15 Jun 2003, 13:36:40 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Eventhandlers for sui
« Reply #7 on: 15 Jun 2003, 13:57:25 »
and get LCD his medication while ur at it  ::)
Proud Member of the Volunteer Commando Battalion

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Eventhandlers for sui
« Reply #8 on: 15 Jun 2003, 18:31:17 »
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
« Last Edit: 15 Jun 2003, 18:36:18 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta