WhoAmI Posted February 27, 2014 Share 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? Link to comment
WhoAmI Posted February 27, 2014 Author Share 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... Link to comment
Anubhav Posted February 27, 2014 Share 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 Link to comment
WhoAmI Posted February 27, 2014 Author Share 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. Link to comment
Anubhav Posted February 27, 2014 Share Posted February 27, 2014 WhoAmI Its not written there that it will on remove scripts sirens.. Atleast try it. And thanks Link to comment
WhoAmI Posted February 27, 2014 Author Share Posted February 27, 2014 I tried it before i wrote this topic, but thanks for trying. Link to comment
WhoAmI Posted February 27, 2014 Author Share 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? Link to comment
manve1 Posted February 27, 2014 Share 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. Link to comment
WhoAmI Posted February 27, 2014 Author Share Posted February 27, 2014 You mean when key state is down the play sound, when up - stop sound? Link to comment
manve1 Posted February 27, 2014 Share 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 Link to comment
WhoAmI Posted February 27, 2014 Author Share Posted February 27, 2014 Yea, I found horn's sound and I did the job. Thanks. Link to comment
myonlake Posted February 28, 2014 Share 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. Link to comment
WhoAmI Posted February 28, 2014 Author Share Posted February 28, 2014 Well I did this. When they key state is "down" sound is on, if "up" off. Link to comment
myonlake Posted February 28, 2014 Share 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. Link to comment
WhoAmI Posted February 28, 2014 Author Share 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. Link to comment
cheez3d Posted February 28, 2014 Share Posted February 28, 2014 playSFX3D This function was added with a reason. Link to comment
WhoAmI Posted February 28, 2014 Author Share Posted February 28, 2014 Well, thanks, didn't know that there is such a function. Link to comment
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