GetVehicleHoodRatio
From Onset Developer Wiki
Description
__EDIT_ME__
Syntax
GetVehicleHoodRatio(vehicle)
Parameters
- vehicle
__EDIT_ME__
Return Value
- __EDIT_ME__
Example
function cmd_hood(player, ratio)
local vehicle = GetPlayerVehicle(player)
if (vehicle == 0) then
return AddPlayerChat(player, "You must be in a vehicle")
end
if (GetPlayerVehicleSeat(player) ~= 1) then
return AddPlayerChat(player, "You must be the driver of the vehicle")
end
if (ratio == nil) then
if (GetVehicleHoodRatio(vehicle) > 0.0) then
SetVehicleHoodRatio(vehicle, 0.0)
else
SetVehicleHoodRatio(vehicle, 60.0)
end
else
ratio = tonumber(ratio)
if (ratio > 90.0) then
ratio = 90.0
elseif (ratio < 0.0) then
ratio = 0.0
end
SetVehicleHoodRatio(vehicle, ratio)
end
end
AddCommand("hood", cmd_hood)
See also
__EDIT_ME__