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