Jump to content

/setmaxspeed and /setaccelaration


jeremaniak

Recommended Posts

addCommandHandler('setaccelaration', 
function(plr,cmd,accelaration) 
    if isPedInVehicle(plr) and getPedOccupiedVehicleSeat(plr) == 0 then 
        if tonumber(accelaration) >= 0 and tonumber(accelaration) <= 100000 then 
        vehicle = getPedOccupiedVehicle(plr) 
        setVehicleHandling(vehicle,'engineAcceleration',tonumber(accelaration)) 
        else 
        outputChatBox('ERROR',plr,255,0,0) 
        end 
    end 
end 
) 
  
addCommandHandler('setmaxspeed', 
function(plr,cmd,maxVelocity) 
    if isPedInVehicle(plr) and getPedOccupiedVehicleSeat(plr) == 0 then 
        if tonumber(maxVelocity) >= 0.1 and tonumber(maxVelocity) <= 200000 then 
        vehicle = getPedOccupiedVehicle(plr) 
        setVehicleHandling(vehicle,'maxVelocity',tonumber(maxVelocity)) 
        else 
        outputChatBox('ERROR',plr,255,0,0) 
        end 
    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...