OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 22jacket on 01 Sep 2005, 01:10:31
-
Hi ho...
is there any way that I can count how many targets have been knocked down after shooting at them ie...30 targets in range 20 knocked down..score shows on screen like 30/20 etc..
cheers
22jacket
-
add an event handler to each target's init
for instance:
target1 addEventHandler ["killed",{playerScore = playerScore + 1}]
then, if the variable "playerScore" were over 20 you could end the mission or something. Or even display it.
EDIT: also, you could just use
this addEventHandler ["killed",{playerScore = playerScore + 1}] and copy and paste into the inits of all targets
-
Just remember to create playerScore first. Put
playerScore = 0
in the init.sqs file or in a trigger that fires before you start shooting the targets.