Jump to content

Whats going wrong?


joedajoester

Recommended Posts

Hi, something is going wrong, the timer isnt doing anything.

function Break(player) 
   if (not isPedInVehicle(player)) then return end 
    local vehicle = getPedOccupiedVehicle(player) 
    local handling = getVehicleHandling(vehicle) 
    setElementData(vehicle, "slowing", vehicle) 
    setVehicleHandling(vehicle, "brakeDeceleration", 20.08) 
    setVehicleHandling(vehicle, "tractionMultiplier", 2.08) 
end 
 function Breakoff(vehicle) 
setTimer (Breakoff, 5000, 0) 
    local handling = getElementData(vehicle, "slowing") 
    setVehicleHandling(vehicle, "brakeDeceleration", slowing) 
    setVehicleHandling(vehicle, "tractionMultiplier", slowing) 
 end 
addCommandHandler ( "break", Break ) 

Link to comment

Maybe because you never used it?

function Break(player) 
    if (not isPedInVehicle(player)) then return end 
    local vehicle = getPedOccupiedVehicle(player) 
    local handling = getVehicleHandling(vehicle) 
    setElementData(vehicle, "slowing", vehicle) 
    setVehicleHandling(vehicle, "brakeDeceleration", 20.08) 
    setVehicleHandling(vehicle, "tractionMultiplier", 2.08) 
    setTimer (Breakoff, 5000, 0, vehicle) 
end 
addCommandHandler ( "break", Break ) 
  
function Breakoff(vehicle) 
    local handling = getElementData(vehicle, "slowing") 
    setVehicleHandling(vehicle, "brakeDeceleration", slowing) 
    setVehicleHandling(vehicle, "tractionMultiplier", slowing) 
 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...