GetWeaponAmmo

From GECK
Jump to: navigation, search


A function added by the Fallout Script Extender.

Description

Returns the ammo (or FormList of Ammo) used by the specified Weapon BaseForm. If weapon is omitted and a calling reference is provided, that reference's BaseForm is used.

Syntax

[help]
(ammoOrFormlist:baseForm) weaponRefr.GetWeaponAmmo weapon:baseform 

Or:

(ammoOrFormlist:baseForm) weaponRefr.GetAmmo weapon:baseform 

Example

ref rAmmo
set rAmmo to GetWeaponAmmo Weap10mmPistol

Notes

  • Beware that in Fallout: New Vegas, weapons may use either an ammo (typecode: 41) or a form list (typecode: 85) containing multiple ammos for this field. To be safe, one can use GetType to check the return. Also, Weapons that do not use ammo will return 0.

See Also