
Air horn script
#1
Guest_francismori7_*
Posted 09 July 2008 - 08:04 PM
#2
Posted 09 July 2008 - 08:19 PM
Wanna play multiplayer without any of the commitment? Emergency Planet hosts casual multiplayer to all its members! Contact me for more information
Executive Director: EMP Gulag
Do you have a warning that you want to go away, or are you facing another punishment you don't want? Contact me for the NEW alternative!
#3
Guest_francismori7_*
Posted 09 July 2008 - 08:31 PM
I will post the code here toowell as far as I know, it would be make a new script for the button, then put one in to activate airhorn.wav And Francis, If you do that, I want a copy, and I'm pretty sure alot of people will want one too!

#5
Guest_francismori7_*
Posted 09 July 2008 - 09:06 PM
Would you mind posting the code? Thanks.Lol i did that script yesterday!
it works, but i have some problems with the icon.Look the screen
![]()
#7
Guest_francismori7_*
Posted 09 July 2008 - 09:12 PM
#8
Guest_francismori7_*
Posted 09 July 2008 - 09:15 PM
Click > Beep
Not
Click > Beeeeeeeeeeeeeeeeeeeeeeeeeep(until Click)
See?
#10
Guest_francismori7_*
Posted 09 July 2008 - 09:25 PM
The horn: Yes, not sirens, if I click once, it does "beep". If I click twice(2 times), it does this: "beep beep". Understand?you talk about the siren? just beep instead a long sound?
(sorry for my bad english)
#11
Guest_lord_bonev_*
Posted 09 July 2008 - 09:37 PM
#13
Posted 09 July 2008 - 09:42 PM
Wanna play multiplayer without any of the commitment? Emergency Planet hosts casual multiplayer to all its members! Contact me for more information
Executive Director: EMP Gulag
Do you have a warning that you want to go away, or are you facing another punishment you don't want? Contact me for the NEW alternative!
#14
Guest_francismori7_*
Posted 09 July 2008 - 09:49 PM
I just want it to be played once.It shouldn't be much harder than what you have, I'll take a look at the script, and for the button, I can't really help you
What params this uses?
Audio::PlaySample3D(*,*,*);
Sirens: Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren06.wav", CarPos, true);
Repeating? ------------------------------------------------------------------------------------------------^
I uploaded my airhorn.wav:
#15
Guest_lord_bonev_*
Posted 09 July 2008 - 10:25 PM
Good job! This sound ("beep") is the most used in my country from police cars and other special vehicles. The sound is cool :1046275747_biggthumpup: But only for police cars in the mod, is have a way to used and for other vehicles? Or i try to rename tha all files?I just want it to be played once.
What params this uses?
Audio::PlaySample3D(*,*,*);
Sirens: Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren06.wav", CarPos, true);
Repeating? ------------------------------------------------------------------------------------------------^
I uploaded my airhorn.wav:
#16
Guest_francismori7_*
Posted 09 July 2008 - 10:54 PM
#17
Guest_francismori7_*
Posted 10 July 2008 - 01:03 AM
#18
Guest_francismori7_*
Posted 10 July 2008 - 01:35 AM
const char CMD_AUTOSIREN_OFF[] = "VcmdAutoSirenOff"; const char EACTION_FINDPATH[] = "EActionFindPath"; const char EACTION_EXTINGUISH[] = "EActionExtinguish"; const char DUMMY_HASSIREN[] = "DummyHasSiren"; const char DUMMY_UPDATEPOS[] = "DummyUpdatePos"; const char DUMMY_FINDPATH[] = "DummyFindPath"; const char NAME_DUMMYOBJECT[] = "HelpingObjekt_Hoppah"; const char PROTO_ENGINE01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine1.e4p"; const char PROTO_ENGINE02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine2.e4p"; const char PROTO_WATERTENDER01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/water_tender.e4p"; const char PROTO_WATERTENDER02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/water_tender_hose_connections.e4p"; const char PROTO_LADDER[] = "mod:Prototypes/Vehicles/02 LA Fire Department/aerial_ladder.e4p"; const char PROTO_HAZMAT[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p"; const char PROTO_MOTORBOAT[] = "mod:Prototypes/Vehicles/02 LA Fire Department/motorboat_transporter.e4p"; const char PROTO_CRASHTENDER[] = "mod:Prototypes/Vehicles/02 LA Fire Department/crashtender.e4p"; const char PROTO_USAR[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p"; const char PROTO_MCU01[] = "mod:Prototypes/Vehicles/01 LA Ambulance/mass_casualty_unit.e4p"; const char PROTO_MCU02[] = "mod:Prototypes/Vehicles/01 LA Ambulance/mass_casualty_unit2.e4p"; const char PROTO_BCV[] = "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p"; const char PROTO_HES[] = "mod:Prototypes/Vehicles/02 LA Fire Department/heavy_equipment_squad.e4p"; const char PROTO_BRUSH[] = "mod:Prototypes/Vehicles/02 LA Fire Department/brush_truck.e4p"; const char PROTO_USFS01[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usfs_utility.e4p"; const char PROTO_USFS02[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usfs_engine.e4p"; const char PROTO_EMS[] = "mod:Prototypes/Vehicles/01 LA Ambulance/cv_ems.e4p"; const char PROTO_AMBULANCE01[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p"; const char PROTO_AMBULANCE02[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance02.e4p"; const char PROTO_AMBULANCE03[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance03.e4p"; const char PROTO_AMBULANCE04[] = "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance04.e4p"; const char PROTO_CORONERS[] = "mod:Prototypes/Vehicles/01 LA Ambulance/coroners_van.e4p"; const char PROTO_DOGTRUCK[] = "mod:Prototypes/Vehicles/01 LA Ambulance/suv_rescue_dog.e4p"; const char PROTO_MOTORCYCLE[] = "mod:Prototypes/Vehicles/03 LA Police/motorcycle_lapd.e4p"; const char PROTO_CV_LAPD[] = "mod:Prototypes/Vehicles/03 LA Police/cv_lapd.e4p"; const char PROTO_CV_LAPD_ST[] = "mod:Prototypes/Vehicles/03 LA Police/cv_lapd_slicktop.e4p"; const char PROTO_CV_LAAP[] = "mod:Prototypes/Vehicles/03 LA Police/cv_laap.e4p"; const char PROTO_CV_LAPP[] = "mod:Prototypes/Vehicles/03 LA Police/cv_lapp.e4p"; const char PROTO_CV_UMPC[] = "mod:Prototypes/Vehicles/03 LA Police/cv_umpc.e4p"; const char PROTO_CV_CHP[] = "mod:Prototypes/Vehicles/03 LA Police/cv_chp.e4p"; const char PROTO_CV_LASD[] = "mod:Prototypes/Vehicles/03 LA Police/cv_lasd.e4p"; const char PROTO_CAMARO[] = "mod:Prototypes/Vehicles/03 LA Police/camaro_chp.e4p"; const char PROTO_CHARGER[] = "mod:Prototypes/Vehicles/03 LA Police/dodge_charger.e4p"; const char PROTO_SUV_LAPD[] = "mod:Prototypes/Vehicles/03 LA Police/suv_lapd.e4p"; const char PROTO_RESCUE01[] = "mod:Prototypes/Vehicles/03 LA Police/rescue_truck01_lapd.e4p"; const char PROTO_RESCUE02[] = "mod:Prototypes/Vehicles/03 LA Police/rescue_truck02_lapd.e4p"; const char PROTO_SWAT_TRUCK[] = "mod:Prototypes/Vehicles/03 LA Police/swat_truck.e4p"; const char PROTO_WATERCANNON[] = "mod:Prototypes/Vehicles/03 LA Police/swat_armoured_vehicle.e4p"; const char PROTO_HUMMERH2_LASD[] = "mod:Prototypes/Vehicles/03 LA Police/hummerh2_lasd.e4p"; const char PROTO_BOMB_SQUAD[] = "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p"; int DummyGroup = 22; object VcmdHorn : CommandScript { VcmdHorn() { SetIcon("sirens"); SetCursor("sirens"); SetRestrictions(RESTRICT_SELFEXECUTE); SetPossibleCallers(ACTOR_VEHICLE); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid()) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if (!Target->IsValid() || Target->GetID() != Caller->GetID()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Vehicle v(Caller); if (!v.HasCommand(DUMMY_HASSIREN)) { int soundID; Vector CarPos = v.GetPosition(); soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/airhorn.wav", CarPos, false); Audio::StopSample(soundID); } } }; object DummyHasSiren : CommandScript { DummyHasSiren() { SetGroupID(DummyGroup); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { } };
The best way would be by setting a timer to "Audio::StopSample(soundID);". But how?

#19
Guest_francismori7_*
Posted 10 July 2008 - 02:08 AM
I fixed your code so the icon will show up correctly:ok
![]()
LAsiren
LASiren.script
PS: Also need help for the post above.
EDIT: WOW. WTF. Quadruple post

#20
Guest_firefighter116_*
Posted 10 July 2008 - 04:50 AM