966 <code language="lua"> |
966 <code language="lua"> |
967 -- Appends a text to the ammo tooltip of the bazooka but leaves name and main description intact |
967 -- Appends a text to the ammo tooltip of the bazooka but leaves name and main description intact |
968 SetAmmoTexts(amBazooka, "This weapon deals double the damage than usually.")</code> |
968 SetAmmoTexts(amBazooka, "This weapon deals double the damage than usually.")</code> |
969 |
969 |
970 ==== <tt>!AddAmmo(gearUid, ammoType, ammoCount) (0.9.16) </tt> ==== |
970 ==== <tt>!AddAmmo(gearUid, ammoType, ammoCount) (0.9.16) </tt> ==== |
971 Adds `ammoType` to the specified gear. The amount added is determined by the arguments passed via `SetAmmo()` in the `onAmmoStoreInit()` event handler. In 0.9.16 ammo can be set directly via the optional third parameter, `ammoCount`. A value of 0 will remove the weapon, a value of 100 will give infinite ammo. |
971 Adds `ammoType` to the specified gear. The amount added is determined by the arguments passed via `SetAmmo()` in the `onAmmoStoreInit()` event handler. `ammoCount` is an optional parameter. If this is set, the ammo will **not** be added, but instead set to `ammoCount`. A value of 0 will remove the weapon, a value of 100 will give infinite ammo. |
972 |
|
973 *Note:* The effectiveness of this function may be limited due to problems with `gfPerHogAmmo` in Lua scripting. |
|
974 |
972 |
975 ==== <tt>!GetAmmoName(ammoType [, ignoreOverwrite ])</tt> (0.9.23) ==== |
973 ==== <tt>!GetAmmoName(ammoType [, ignoreOverwrite ])</tt> (0.9.23) ==== |
976 Returns the localized name for the specified `ammoType`, taking an ammo name overwritten by `SetAmmoTexts` into account. If `ignoreOverwrite` is `true`, this function will always return the original ammo name of the weapon and ignores names which may have been overwritten by `SetAmmoTexts`. |
974 Returns the localized name for the specified `ammoType`, taking an ammo name overwritten by `SetAmmoTexts` into account. If `ignoreOverwrite` is `true`, this function will always return the original ammo name of the weapon and ignores names which may have been overwritten by `SetAmmoTexts`. |
977 |
975 |
978 === Map === |
976 === Map === |