Jump to content

Ayuda funcion


Atouk

Recommended Posts

Hola, necesito ayuda con una funcion...

El problema es que quiero que tome el valor del handling actual y no el original.... Por ejemplo: si el hand actual es 5. Que tome el de 5 + el upgrade. No que tome el original de GTA SA.

Aqui el script:

addEventHandler("tuning->PerformanceUpgrade", root, function(vehicle, data)
	if vehicle then
		if data then
			local vehicleModel = getElementModel(vehicle)
			
			if not data[1][2] then -- Default upgrade
				for _, property in ipairs(data) do
					setVehicleHandling(vehicle, property[1], nil, false)
				end
			else
				for _, property in ipairs(data) do
					local defaultHandling = getOriginalHandling(vehicleModel)[property[1]]
					
					setVehicleHandling(vehicle, property[1], defaultHandling, false)
					setVehicleHandling(vehicle, property[1], defaultHandling + property[2], false)
				end
			end
		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...