OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Sanyix on 05 Oct 2005, 18:48:00

Title: Incoming missle eventhandler in config.cpp
Post by: Sanyix 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?
Title: Re:Incoming missle eventhandler in config.cpp
Post by: Platoon Patton on 05 Oct 2005, 18:54:04
I think U need to write it that way:

incomingMissile = "(_this select 0) vehicleChat ""Incoming Missle!"""
Title: Re:Incoming missle eventhandler in config.cpp
Post by: Sanyix 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!
Title: Re:Incoming missle eventhandler in config.cpp
Post by: Platoon Patton 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 :))