# HG changeset patch # User Wuzzy # Date 1531005815 -3600 # Node ID 640e28c5c86060d3706d39673cd54f9ea8d98dec # Parent 4a31af3814634adb8d3c0b2c08cc43404475897a LuaAPI: Define SetAmmo parameters diff -r 4a31af381463 -r 640e28c5c860 LuaAPI.wiki --- a/LuaAPI.wiki Sat Jul 07 18:40:59 2018 +0100 +++ b/LuaAPI.wiki Sun Jul 08 00:23:35 2018 +0100 @@ -1061,10 +1061,18 @@ === Ammo === ==== !SetAmmo(ammoType, count, probability, delay, numberInCrate) ==== -This updates the settings for a specified [AmmoTypes Ammo Type] as of count available for players, spawn probability, availability delay in turns, and the number available in crates. This is supposed to be used in the `onAmmoStoreInit()` event handler. +This updates the settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This must only be used in the `onAmmoStoreInit()` event handler. In other places, this function will not work. In Lua missions, for *all* ammo types, the ammo count, probability, delay and number in crates is set to 0 initially. Note: This also includes skip! +Parameters: + +* `ammoType`: Ammo type to be set +* `count`: Initial ammo count. 9 = infinite +* `probability`: Crate probability. Max. value is 9. 0 = never +* `delay`: Number of rounds this ammo is delayed +* `numberInCrate`: Amount of ammo in a crate + Example: SetAmmo(amShotgun, 9, 0, 0, 0) -- unlimited amount of shotgun ammo for players