OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Acecool on 06 Mar 2005, 17:12:03

Title: Getting ammo, reload, fired etc etc..
Post by: Acecool on 06 Mar 2005, 17:12:03
A few questions regarding weapons, ammo and so on...

How do I find if the player:
fired a shot (eventhandler "fired" - solved)
reloaded his/he weapon
dropped his/her weapon
dropped a magazine from his/her weapon
picked up a weapon
picked up a magazine

Ammo in current weapon (primary / secondary)

get if current weapon is primary (big, on back)
or weapon is secondary (small, in pocket)
Title: Re:Getting ammo, reload, fired etc etc..
Post by: Roni on 09 Mar 2005, 05:51:58
Hi AC

You can always write a script that checks the loon every 2-3 seconds and counts the number of magazines and weapons carried, then compares that figure against the last check.

For example -

_magazinesCheck1 = magazines loon1

#loop
_magazinesCheck2 = magazines loon1
if _magazinesCheck2 < _magazinesCheck1 then _magazinesFired = 1
_magazinesCheck1 < _magazinesCheck2
~3
goto "loop"


You can use the same syntax to check for shots in the weapons first magazine (_ammoCheck1 = loon1 ammo "m16") or the unit's primary weapon (_weaponCheck1 = primaryWeapon loon1).  All you need is a check1 and check2 version and a routine to compare them, as above.

Hope that this helps.



roni