Hi,
I want to create a timer when vehicle have 0 HP, but I dont know if the hook "EntityTakeDamage" work for VCMOD ?
You think that work ? (I can't test now sorry) :
[CODE]hook.Add("EntityTakeDamage", "VehicleHPHook", function( ent, dmginfo )
if IsValid(ent) and ent.VC_Health == 0 then
if VC_RepairHealth then VC_RepairHealth(ent) end
if VC and VC.RepairHealth then VC.RepairHealth(ent) end
end
end)[/CODE]
Thanks.
Feel free to use this hook or any of his other functions here:
[url]http://vcmod.org/devcorner/?sel=hooks_VC_HealthChanged[/url]
His example:
[code]
hook.Add("VC_HealthChanged", "CustomHookName", function(ent, ohealth, nhealth)
print("This vehicles health has changed from: "..ohealth.." to "..nhealth..".")
end)
[/code]
Where oHealth is the health before being damaged, and nHealth being the new health after being damaged.
Sorry, you need to Log In to post a reply to this thread.