HIT EVENT
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING
Page 1 of 1
HIT EVENT
I bring to your attention the following code:
this code allows to separate the events of the vehicle damage.
- Code:
-------------- Check vehicle mfct status ----
function onHit_ca1(victim, attacker)
hitpoint = hitpoint +1;
if hitpoint >= 10 then
OFP:disableEvent("onHit_ca1");
OFP:addTimer("HitCaP",300);
OFP:addTimer("HitCaF",200);
hitpoint = 0;
end
end
function onTimerHitCaP()
if (OFP:isMobilityKill("ca1") == true) and (caDestroyCA1 == 0)
and (destroyCA1 == 0) and (damage2 == 0) then
mobilityCA1 = 1;
end
if (OFP:isFirepowerKill ("ca1") == true) and (caDestroyCA1 == 0)
and (destroyCA1 == 0) and (damage1 == 0) then
firepowerCA1 = 1;
end
if damage0 == 0 then
OFP:addTimer("CollisionCheck",100);
end
OFP:removeTimer("HitCaP");
end
function onTimerHitCaF()
if (OFP:isCatastrophicallyDestroyed("ca1") == true) then
OFP:displaySystemMessage("Catastrophical");
caDestroyCA1 = 1;
end
if (OFP:isDestroyed("ca1") == true) and (caDestroyCA1 == 0) then
OFP:displaySystemMessage("Destroyed");
destroyCA1 = 1;
end
OFP:removeTimer("HitCaF");
end
function onTimerCollisionCheck()
OFP:displaySystemMessage("Collision check..");
if mobilityCA1 == 1 and firepowerCA1 == 1 then
OFP:displaySystemMessage("Firepower and Mobility");
damage0 = 1;
end
if mobilityCA1 == 0 and firepowerCA1 == 1 and damage1 == 0 then
OFP:displaySystemMessage("Firepower only");
damage1 = 1;
end
if mobilityCA1 == 1 and firepowerCA1 == 0 and damage2 == 0 then
OFP:displaySystemMessage("Mobility only");
damage2 = 1;
end
OFP:enableEvent("onHit_ca1");
OFP:displaySystemMessage("..check out");
OFP:removeTimer("CollisionCheck");
end
this code allows to separate the events of the vehicle damage.
Last edited by Razer01 on Tue 02 May 2023, 23:42; edited 1 time in total (Reason for editing : -)
Razer01- Points : 12
Reputation : 1
Join date : 2014-12-15
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|