Hello everybody, I'm new to lua and to this i tried a couple things for changing the handling for the police SF id 597, can anybody tell me what i did wrong, i saw this handling in another topic and i tried to change it.
vehicleIDS = { 597, }
function changeHandling ( )
for _, model in ipairs ( vehicleIDS ) do
setModelHandling ( model, "maxVelocity", 800 )
setModelHandling ( model, "acceleration", 25 )
setModelHandling ( model, "tractionMultiplier", 5 )
end
end
addEventHandler ( "onResourceStart", resourceRoot, changeHandling )
and this one i got it from somewhere:
allowedTeams = {
["Police"] = true,
["Armed Force"] = true,
}
function handlingChange32 (theVehicle32, seat)
if allowedClasses[getElementData(source,"Team")] and getElementModel(theVehicle32) == 597 and seat == 0 then
setVehicleHandling(theVehicle32, "maxVelocity", 300)
setVehicleHandling(theVehicle32, "engineAcceleration", 25)
setVehicleHandling(theVehicle32, "collisionDamageMultiplier", 0)
setVehicleHandling(theVehicle32, "modelFlags", 0x1C00000)
elseif not allowedTeams[getElementData(source,"Team")] and getElementModel(theVehicle32) == 597 and seat == 0 then
originalHandlingTable[theVehicle32] = getOriginalHandling(getElementModel(theVehicle32))
if originalHandlingTable[theVehicle32] then
handlingChangeBack32(theVehicle32,seat)
end
end
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), handlingChange32 )
function handlingChangeBack32(theVehicle32,seat)
if allowedClasses[getElementData(source,"Team")] and getElementModel(theVehicle32) == 597 and seat == 0 then
if originalHandlingTable[theVehicle32] then
setVehicleHandling(theVehicle32, "maxVelocity", originalHandlingTable[theVehicle32].maxVelocity)
setVehicleHandling(theVehicle32, "engineAcceleration", originalHandlingTable[theVehicle32].engineAcceleration)
setVehicleHandling(theVehicle32, "engineInertia", originalHandlingTable[theVehicle32].engineInertia)
setVehicleHandling(theVehicle32, "collisionDamageMultiplier", originalHandlingTable[theVehicle32].collisionDamageMultiplier)
setVehicleHandling(theVehicle32, "modelFlags", originalHandlingTable[theVehicle32].modelFlags)
end
end
end
thanks i hope you can help me.
regards thelaser
Edit: i see that i posted it on the wrong forum, sorry for that
Question
thelaser
Hello everybody, I'm new to lua and to this i tried a couple things for changing the handling for the police SF id 597, can anybody tell me what i did wrong, i saw this handling in another topic and i tried to change it.
and this one i got it from somewhere:
thanks i hope you can help me.
regards thelaser
Edit: i see that i posted it on the wrong forum, sorry for that
Link to comment
1 answer to this question
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