Home   Help Search Login Register  

Author Topic: Incoming missle eventhandler in config.cpp  (Read 1649 times)

0 Members and 1 Guest are viewing this topic.

Sanyix

  • Guest
Incoming missle eventhandler in config.cpp
« on: 05 Oct 2005, 18:48:00 »
Hi!

I've made an addon for MP game, and I want to upgrade the aircrafts, with incoming missle messages, on vehiclechat.
I tried this eventhandler:
class EventHandlers
         {
         incomingMissile = "this vehicleChat ""Incoming Missle!"""
         };
But it's not working, if an AA missle shot to the aircraft, ofp writes error: expected object. So in eventhandler, the "this" command isn't indentify that aircraft, what have this eventhandler. What sould i do?
« Last Edit: 05 Oct 2005, 18:48:26 by Sanyix »

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Incoming missle eventhandler in config.cpp
« Reply #1 on: 05 Oct 2005, 18:54:04 »
I think U need to write it that way:

incomingMissile = "(_this select 0) vehicleChat ""Incoming Missle!"""
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 ;)

Sanyix

  • Guest
Re:Incoming missle eventhandler in config.cpp
« Reply #2 on: 05 Oct 2005, 19:28:01 »
I think U need to write it that way:

incomingMissile = "(_this select 0) vehicleChat ""Incoming Missle!"""

It's working correctly :)
LOL i did't thought this was the problem, and it's very simple :D

Thank you!

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:Incoming missle eventhandler in config.cpp
« Reply #3 on: 05 Oct 2005, 21:13:30 »
No Problemo m8,

I made something similar lately,You can use it if U want:

Code: [Select]
Warning.sqs
_vehc = _this select 0
_thing = _this select 1
_dude = _this select 2
_muppet = name _dude

?!(player in _vehc):exit

?!( alive _vehc ): Exit

enableradio true
~0.2
?(side _dude == side player):_vehc vehiclechat format["Goddamn %1 is shooting us with his %2 @#^*$&!",_muppet,_thing]
?(side _dude != side player):_vehc vehiclechat format ["Incoming Missile ALERT!!!,%1 just locked on and fired with %2!!!",_muppet,_thing]



Playsound "incoming"
~0.3
Playsound "incoming"
~0.3
Playsound "incoming"
~0.3
Playsound "incoming"
~0.3
Playsound "incoming"
~0.3
Playsound "incoming"
~0.3
enableradio false

All U need to do is run Warning.sqs in your config.cpp.

And ofcourse define "incoming" sound...
(If U want the "incoming" ogg. just let me know :))

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 ;)