Skuleris Posted August 12, 2013 Share Posted August 12, 2013 Hi! Is there any way to remove siren from fbi rancher? I mean that siren, when fastly press H. I tried "removeVehicleSirens", but didn't work, because need to add sirens first. Link to comment
Cruze Posted August 12, 2013 Share Posted August 12, 2013 Can you give us the code? P.S Check wiki [url=https://wiki.multitheftauto.com/wiki/RemoveVehicleSirens]https://wiki.multitheftauto.com/wiki/Re ... icleSirens[/url] Link to comment
Skuleris Posted August 13, 2013 Author Share Posted August 13, 2013 This not working, because before you remove you need to add that - addVehicleSirens And i tried almost everything >> addEventHandler("onVehicleEnter",root,function(player,seat) if(player)and(seat==0)then removeVehicleSirens(source) end end) local rancher = (getElementsByType("vehicle") and getElementModel(490)) for i,vehicle in ipairs(rancher) do removeVehicleSirens(rancher) end function removeSiren ( fbirancher ) if getElementsByType ( fbirancher ) == "vehicle" and getElementModel ( fbirancher ) == 490 then removeVehicleSirens ( fbirancher ) end end addEventHandler ( "onResourceStart", getRootElement(), removeSiren ) These three didn't work. Link to comment
denny199 Posted August 13, 2013 Share Posted August 13, 2013 "removeVehicleSirens" isn't working since it's only for costum sirenes use: https://wiki.multitheftauto.com/wiki/SetVehicleSirensOn function VehicleEnter ( thePlayer, seat, jacked ) if ( seat == 0 ) and (getElementModel ( source ) == 490) then setVehicleSirensOn ( source, false ) bindKey ( thePlayer, "h", "down", disableSiren ) end end addEventHandler ( "onVehicleEnter", getRootElement(), VehicleEnter ) function exitVehicle ( thePlayer, seat, jacked ) if ( seat == 0 ) and (getElementModel ( source ) == 490) then setVehicleSirensOn ( source, false ) unbindKey ( thePlayer, "h", "down", disableSiren ) end addEventHandler ( "onVehicleStartExit", getRootElement(), exitVehicle ) function disableSiren (presser) if not isPedInVehicle (presser) then unbindKey ( presser, "h", "down", disableSiren ) elseif isPedInVehicle (presser) then if getVehicleSirensOn ( getPedOccupiedVehicle ( presser) ) then setVehicleSirensOn ( getPedOccupiedVehicle ( presser), false ) end end end Not tested. Link to comment
Skuleris Posted August 13, 2013 Author Share Posted August 13, 2013 denny199 added "end" after 14 line, to fix warning. Added debug strings, so i know the problem - siren toggling on, when you press h, not turning off. Gonna try to fix it. Fixed, denny199 big thanks for this, its working. Setted up timer and remove getVehicleSirensOn and its working. function VehicleEnter ( thePlayer, seat, jacked ) if ( seat == 0 ) and (getElementModel ( source ) == 490) then setVehicleSirensOn ( source, false ) bindKey ( thePlayer, "h", "down", disableSiren ) end end addEventHandler ( "onVehicleEnter", getRootElement(), VehicleEnter ) function exitVehicle ( thePlayer, seat, jacked ) if ( seat == 0 ) and (getElementModel ( source ) == 490) then setVehicleSirensOn ( source, false ) unbindKey ( thePlayer, "h", "down", disableSiren ) end end addEventHandler ( "onVehicleStartExit", getRootElement(), exitVehicle ) function disableSiren (presser) if not isPedInVehicle (presser) then unbindKey ( presser, "h", "down", disableSiren ) elseif isPedInVehicle (presser) then setTimer ( function() setVehicleSirensOn ( getPedOccupiedVehicle ( presser), false ) end, 250, 1 ) end end 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