Skip to main content

PedGetThrottle

This function was added in DSL 7

Description

Get a ped's current throttle value.

function PedGetThrottle(ped) --[[ ... ]] end

Parameters

  • ped: integer - The ped to get the throttle value from.

Return Values

  • throttle: number - The current throttle value of the ped, ranging from 0.0 (no throttle) to 1.5 (full throttle).

Example

local target = PedGetTargetPed(gPlayer)
if PedIsValid(target) then
local name = GetLocalizedText(PedGetName(target))
local throttle = PedGetThrottle(target)
DrawTextInline(name .. ': ' .. tostring(throttle), 0.1, 1)
end

See Also