#RooTs Posted June 28, 2015 Posted June 28, 2015 (edited) Hello guys I'm trying to set this function to the player does not fire in overhead the bike. What is wrong? function disableFireForHydra ( theVehicle, seat ) local Vehicle = getPedOccupiedVehicle(getLocalPlayer()) if Vehicle then local Type = getVehicleType(Vehicle) if Type == "Motorbikes" or Type == "Bicycles" then toggleControl ( "vehicle_secondary_fire", false ) else toggleControl ( "vehicle_secondary_fire", true ) end end end addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), disableFireForHydra ) other controls to set toggleControl ( "aim_weapon", false) toggleControl ( "vehicle_fire", false) toggleControl ( "fire", false) Edited June 29, 2015 by Guest
Walid Posted June 28, 2015 Posted June 28, 2015 Hello ? be patient bro , anyways try this local vehicleType = {["BMX"] = true, ["Bike"] = true} local controls = {"vehicle_secondary_fire","vehicle_secondary_fire","aim_weapon","vehicle_fire", "fire"} function disableFire ( theVehicle, seat ) if theVehicle then local Type = getVehicleType(theVehicle) if vehicleType[Type] then for i, v in pairs(controls) do toggleControl(tostring(v), false) end else for i, v in pairs(controls) do toggleControl(tostring(v), true) end end end end addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), disableFire )
#RooTs Posted June 29, 2015 Author Posted June 29, 2015 @Walid, he blocks even with the "realdriveby" linked ?
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