HUD
Functions

Vehicle: set Health

Allows to set vehicles health.

Used in: VCMod Main addon.

Server Entity Vehicle:VC_setHealth(Integer health)

Arguments

1. Integer health; Health
New health amount.

Example

concommand.Add("VC_RestoreVehicleHealth", function(ply)
	if !IsValid(ply) then print("Only for players.") return end

	local ent = ply:GetVehicle()
	if IsValid(ent) then

		// Damages the vehicle by 5% of its total health, this can be achieved with: ent:VC_damageHealth()
		local healthMax = ent:VC_getHealthMax()
		local health = ent:VC_getHealth()
		ent:VC_setHealth(health-healthMax/100*5)
	else
		print("Invalid entity.")
	end
end)
Page modified:
...2018-11-02 09:24:41