Jump to content

Remove siren from FBI Rancher


Skuleris

Recommended Posts

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

"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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...