Jump to content
  • 0

help handling doesn't work!


thelaser

Question

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

Link to comment

1 answer to this question

Recommended Posts

  • 0
function handling (  ) 
for _,veh in pairs(getElementsByType("vehicle")) do 
    if getElementModel(veh) == 560 then 
        setVehicleHandling (veh, "mass", 1600) 
        setVehicleHandling(veh, "turnMass", 3921.3) 
        setVehicleHandling(veh, "dragCoeff", 1.8 ) 
        setVehicleHandling(veh, "centerOfMass", { 0, -0.4, 0 } ) 
        setVehicleHandling(veh, "percentSubmerged", 75) 
        setVehicleHandling(veh, "tractionMultiplier", 0.75) 
        setVehicleHandling(veh, "tractionLoss", 0.85) 
        setVehicleHandling(veh, "tractionBias", 0.52) 
        setVehicleHandling(veh, "numberOfGears", 5) 
        setVehicleHandling(veh, "maxVelocity", 400) 
        setVehicleHandling(veh, "engineAcceleration", 20 ) 
        setVehicleHandling(veh, "engineInertia", 10) 
        setVehicleHandling(veh, "driveType", "rwd") 
        setVehicleHandling(veh, "engineType", "petrol") 
        setVehicleHandling(veh, "brakeDeceleration", 10) 
        setVehicleHandling(veh, "brakeBias", 0.53) 
        setVehicleHandling(veh, "steeringLock", 35) 
        setVehicleHandling(veh, "suspensionForceLevel", 1.3) 
        setVehicleHandling(veh, "suspensionDamping", 0.12) 
        setVehicleHandling(veh, "suspensionHighSpeedDamping", 0) 
        setVehicleHandling(veh, "suspensionUpperLimit", 0.28 ) 
        setVehicleHandling(veh, "suspensionLowerLimit", -0.12) 
        setVehicleHandling(veh, "suspensionFrontRearBias", 0.38 ) 
        setVehicleHandling(veh, "suspensionAntiDiveMultiplier", 0) 
        setVehicleHandling(veh, "seatOffsetDistance", 0.2) 
        setVehicleHandling(veh, "collisionDamageMultiplier", 0.24) 
        setVehicleHandling(veh, "monetary", 25000) 
        setVehicleHandling(veh, "modelFlags", 0x40000000) 
        setVehicleHandling(veh, "handlingFlags", 0x10200008 ) 
        setVehicleHandling(veh, "headLight", 0) 
        setVehicleHandling(veh, "tailLight", 1) 
        setVehicleHandling(veh, "animGroup", 0) 
        end 
    end 
  
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), handling ) 
  

Well try using this one i found Tell me if it works...

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...