Jump to content

get the original handling of an element


TrickyTommy

Recommended Posts

Posted

Hello, i want to get the original handling of all vehicles, and boost them a bit. But i can't get their speed, it returns nil! I did not understand the examples online.
 

function realHandling()
	if isTimer (checkVehicles) then killTimer (checkVehicles) end
	local checkVehicles = setTimer (function()
		vehicles = getElementsByType("vehicle")
		for k, v in pairs(vehicles) do

	    local originalHandling = getOriginalHandling(596)

		for k in pairs (originalHandling) do
			outputDebugString (tostring(k["maxVelocity"]))
		end

		if not getElementData (v, "realHandled") then
			end
		end
	end, 50, 0)
end
addEventHandler ("onResourceStart", getRootElement(), realHandling)

 

  • Moderators
Posted
for _, vehicle in pairs(vehicles) do
	local originalHandling = getOriginalHandling(getElementModel(vehicle))
	for _, k in pairs (originalHandling) do

 

Posted
3 hours ago, IIYAMA said:

for _, vehicle in pairs(vehicles) do
	local originalHandling = getOriginalHandling(getElementModel(vehicle))
	for _, k in pairs (originalHandling) do

 

okay, thanks, but how do i ask for example the car's maximum velocity?

  • Moderators
Posted (edited)

You can ask it like this:

"Can you please make an example that shows all the cars their maximum velocity?"

But I am afraid this section isn't for English lessons my friend...

 

 

Edited by IIYAMA
  • Haha 1

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