Home   Help Search Login Register  

Author Topic: Setting Ammo (No 'SetAmmo' Command)  (Read 698 times)

0 Members and 1 Guest are viewing this topic.

Scratchdat

  • Guest
Setting Ammo (No 'SetAmmo' Command)
« on: 25 Mar 2003, 17:50:09 »
Is it possible to set the ammo of a unit (in this case, a helicopter) after some of its ammo has already been fired?

There must be some way, because you can do it with an ammo truck  :o

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Ammo (No 'SetAmmo' Command)
« Reply #1 on: 25 Mar 2003, 18:12:29 »
look up the following commands in the command ref and see if they help you

addMagazine
addMagazines
addWeapon
removeWeapon
removeAllWeapons
Plenty of reviewed ArmA missions for you to play

Scratchdat

  • Guest
Re:Setting Ammo (No 'SetAmmo' Command)
« Reply #2 on: 25 Mar 2003, 18:27:51 »
This probably wont work, for 2 reasons:

1. It is a vehicle, and so doesn't have 'magazines' (also what about Machine Gun in a chopper, does that have magazines? If so good, but missiles dont).

2. The amount of ammo already used is unknown, so i may be adding too little or too much ammo to the chopper.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Ammo (No 'SetAmmo' Command)
« Reply #3 on: 25 Mar 2003, 19:19:02 »
I think it still works for vehicles ..... check the latest weapon and ammo list for the correct names, Kuro's version has them.   The syntax is the same.      The only complication is that sometimes the missile or whatever is counted as a magazine, and sometimes as a weapon.

Adding too many is not a problem - if the unit is already full, then nothing happens.

It is possible to check to see how many rounds/mags/missiles a unit has left but I'm not sure how to do it.     It was mentioned in a thread I read the other day, but I can't remember what it was really about or whether it was this board ... I'll have a look.
Plenty of reviewed ArmA missions for you to play

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Setting Ammo (No 'SetAmmo' Command)
« Reply #4 on: 25 Mar 2003, 19:26:38 »
stuff from the command ref that might be useful


unit ammo magazine

Operand types:
unit: Object
magazine: String
Type of returned value:
Number
Description:
Count how many shots are left for given magazine type.

Example:
player ammo "M16"




unit hasWeapon weaponName

Operand types:
unit: Object
weaponName: String
Type of returned value:
Boolean
Description:
Check if unit has given weapon.

Example:
player hasWeapon "M16"


and I found that thread.
« Last Edit: 25 Mar 2003, 19:33:13 by macguba »
Plenty of reviewed ArmA missions for you to play