Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 How can I play an air horn sound when I press on a command button? I tried to mess with LASiren but no success. I just want to press the button and play airhorn.wav. That's all. Any help? Link to comment Share on other sites More sharing options...
Newfoundking Posted July 9, 2008 Report Share Posted July 9, 2008 well 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! Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 well 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!I will post the code here too Link to comment Share on other sites More sharing options...
Nyox Posted July 9, 2008 Report Share Posted July 9, 2008 Lol i did that script yesterday! it works, but i have some problems with the icon.Look the screen Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 Lol i did that script yesterday! it works, but i have some problems with the icon.Look the screen Would you mind posting the code? Thanks. Link to comment Share on other sites More sharing options...
Nyox Posted July 9, 2008 Report Share Posted July 9, 2008 ok file removedQsiren.wav Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 I will try to see if I can do something. Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 What I want is not really like that. I want this:Click > BeepNotClick > Beeeeeeeeeeeeeeeeeeeeeeeeeep(until Click)See? Link to comment Share on other sites More sharing options...
Nyox Posted July 9, 2008 Report Share Posted July 9, 2008 you talk about the siren? just beep instead a long sound?(sorry for my bad english) Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 you talk about the siren? just beep instead a long sound?(sorry for my bad english)The horn: Yes, not sirens, if I click once, it does "beep". If I click twice(2 times), it does this: "beep beep". Understand? Link to comment Share on other sites More sharing options...
Guest lord_bonev Posted July 9, 2008 Report Share Posted July 9, 2008 Later a will pos my commentar for this "bee" (LAsiren.script) Link to comment Share on other sites More sharing options...
Nyox Posted July 9, 2008 Report Share Posted July 9, 2008 oh, you don't want that the sound is played continuously ?i don't know how to make it, for now Link to comment Share on other sites More sharing options...
Newfoundking Posted July 9, 2008 Report Share Posted July 9, 2008 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 Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 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 youI 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: Link to comment Share on other sites More sharing options...
Guest lord_bonev Posted July 9, 2008 Report Share Posted July 9, 2008 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: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? Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 9, 2008 Report Share Posted July 9, 2008 I just want a command script for it. Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 10, 2008 Report Share Posted July 10, 2008 New code bellow Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 10, 2008 Report Share Posted July 10, 2008 Alright, works almost perfect now. Only one problem. The sound keeps playing. With something other, it does start but, is instantly stopped. Here is the second script: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? Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 10, 2008 Report Share Posted July 10, 2008 ok LAsirenI fixed your code so the icon will show up correctly:LASiren.scriptPS: Also need help for the post above.EDIT: WOW. WTF. Quadruple post Sorry... Link to comment Share on other sites More sharing options...
Guest firefighter116 Posted July 10, 2008 Report Share Posted July 10, 2008 maybe hoppah will give a word of advice Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 10, 2008 Report Share Posted July 10, 2008 Well, it now works, but, doesn't play over the sirens. Link to comment Share on other sites More sharing options...
Guest lord_bonev Posted July 10, 2008 Report Share Posted July 10, 2008 where i must to put this "Qsiren.wav: and the "beep" sound to work for all vehicles? Link to comment Share on other sites More sharing options...
Guest Caddi17 Posted July 10, 2008 Report Share Posted July 10, 2008 Heyy, i was just wondering, where do i put all the files to add them to the mod? Link to comment Share on other sites More sharing options...
Guest francismori7 Posted July 10, 2008 Report Share Posted July 10, 2008 Heyy, i was just wondering, where do i put all the files to add them to the mod?Depends if you want Nyox's or mine. Link to comment Share on other sites More sharing options...
Guest Caddi17 Posted July 10, 2008 Report Share Posted July 10, 2008 Depends if you want Nyox's or mine.Oh, whats the difference between yours and Nyox's? Link to comment Share on other sites More sharing options...