Right, so I tried making some sort of health regeneration script for vehicles.
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; We are an armored vehicle
_vehicle = _this select 0
; check our health
_damage = getDammage _vehicle
; start damage control, start repair when damage is sufficient
#loopcheck
?(0.4 < _damage) : goto "repair"
goto "loopcheck"
; start repairing
#repair
?(0 == _damage) : goto "ending1"
~1.5
_damage = _damage - 0.2
goto "repair"
#ending1
~0.5
_vehicle vehicleChat "Hull repaired"
Exit[/QUOTE]
And the relevant eventhandler for this:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class EventHandlers : ECP_EventHandlers
{
incomingMissile="_this call (ECP_resources select 44); if((_this select 0)==(_this select 0)) then {[_this] exec ""\TerranTank\scripts\spoofmis sile.sqs""}";
hit="if((_this select 0)==(_this select 0)) then {[_this] exec ""\TerranTank\scripts\nanobots .sqs""}";
};[/QUOTE]
And, this gives me an error...![]()
HOME
Reply With Quote

