HUD
Functions

Vehicle: get Health

Displays the current vehicles health. Please note: when using clientside it will always return a percentage value, no matter of the option.

Used in: VCMod Main addon.

Shared Entity Vehicle:VC_getHealth(Boolean perc)

Arguments

1. Boolean perc; Show in percentage
If it should show the health in percentage instead of VCMod units.

Returns

1. Integer Either health in VCMod units or in percentage of the maximum health. Clientside only returns the percentage, no matter of this choice.

Example

concommand.Add("vehicle_gethealth", function()
	local ent = player.GetAll()[1]:GetEyeTraceNoCursor().Entity
	if IsValid(ent) then
		print("Vehicle you are currently looking at health is: "..ent:VC_getHealth(true).." percent.")
	else
		print("Invalid entity.")
	end
end)
Page modified:
...2018-11-02 09:24:38