Home   Help Search Login Register  

Author Topic: Getting ammo, reload, fired etc etc..  (Read 1202 times)

0 Members and 1 Guest are viewing this topic.

Acecool

  • Guest
Getting ammo, reload, fired etc etc..
« 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)
« Last Edit: 06 Mar 2005, 17:12:24 by Acecool »

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Getting ammo, reload, fired etc etc..
« Reply #1 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