OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Jakro on 15 Mar 2018, 13:16:00
-
I am basically making a mission which is very straightforward, just shooting a lot at enemies to train our beginner guys to become better at it.
I thought it would be a cool to have sort of an end statistic that shows for each player how many shots they fired and how many hit. However I dont know much about scripting so I would not know how to do it. Does such script already exist and if not, how would you go about creating it?
Actually just a counter for shots fired by each player would be enough to get an idea since the multiplayer automatically gives you the number of kills you have got.
-
I'm not a MP scripter but anyway :D
code = "if (local player) then {player addRating 0.001}"
player addEventHandler ["fired", code]
To see statistics:
hint format ["%1 fired %2 times", name player, 1000*((rating player) %1)]
For chopper attack mission u can use
vehicle player addEventHandler ["fired", code]
Another way is to compare ammo counts of all weaps before
and after the fight
For M2 hmg:
ammoCount = mg ammo (weapons ms select 0)
shotsHMG = 500 - ammoCount