WhoAmI Posted February 27, 2014 Posted February 27, 2014 Well guys, I want to remove sirens from Barrack's truck, but removeVehicleSirens doesn't work for default gta's sirens. So i thought about turning off sirens, each time when player wants to turn them on. But there is question. How can I do that?
WhoAmI Posted February 27, 2014 Author Posted February 27, 2014 Then I can't play horn at all, I mean delete only sirens. I'm looking for solution for a long time...
Anubhav Posted February 27, 2014 Posted February 27, 2014 (edited) function sirens ( theVehicle, seat, jacked ) if ( getElementModel ( theVehicle ) == 433 ) then removeVehicleSirens( theVehicle ) else return end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), sirens ) Edited February 27, 2014 by Guest
WhoAmI Posted February 27, 2014 Author Posted February 27, 2014 Told you that this function doesn't work for default's GTA sirens, only on added by script. Anyway, should be removeVehicleSirens(theVehicle) instead.
Anubhav Posted February 27, 2014 Posted February 27, 2014 WhoAmI Its not written there that it will on remove scripts sirens.. Atleast try it. And thanks
WhoAmI Posted February 27, 2014 Author Posted February 27, 2014 I tried it before i wrote this topic, but thanks for trying.
WhoAmI Posted February 27, 2014 Author Posted February 27, 2014 I did post in bugs.mtasa.com, and they told me that this function doesn't work for default's one. Anyway, any ideas?
manve1 Posted February 27, 2014 Posted February 27, 2014 use: toggleControl() and for the horn: get when the horn key is pressed and play a sound until the key is released.
WhoAmI Posted February 27, 2014 Author Posted February 27, 2014 You mean when key state is down the play sound, when up - stop sound?
manve1 Posted February 27, 2014 Posted February 27, 2014 Well, I would do it that way. and the sound should be the horn as you mentioned that toggleControl disables sirens + horn
WhoAmI Posted February 27, 2014 Author Posted February 27, 2014 Yea, I found horn's sound and I did the job. Thanks.
myonlake Posted February 28, 2014 Posted February 28, 2014 I would've went for another approach to enable the default GTA horn. Check for how long the client pressed the key, if it was above a certain tick count, then just let them do the horn. I am not sure if this works though, as you have to toggle the control state and I guess MTA doesn't toggle controls in real-time if key is already being pressed before the key is available again... but it would be worth a shot.
WhoAmI Posted February 28, 2014 Author Posted February 28, 2014 Well I did this. When they key state is "down" sound is on, if "up" off.
myonlake Posted February 28, 2014 Posted February 28, 2014 Yes, but I am not talking about custom sounds, which you are using. I am talking about the same horn sound without any need to download sound files.
WhoAmI Posted February 28, 2014 Author Posted February 28, 2014 Well yea, but I found in GTASA files exactly same horn as barrack's one, so I'll stay with this solution.
cheez3d Posted February 28, 2014 Posted February 28, 2014 playSFX3D This function was added with a reason.
WhoAmI Posted February 28, 2014 Author Posted February 28, 2014 Well, thanks, didn't know that there is such a function.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now