LuaAPI: Define SetAmmo parameters
authorWuzzy
Sun, 08 Jul 2018 00:23:35 +0100
changeset 1425 640e28c5c860
parent 1424 4a31af381463
child 1426 2a4793897bb1
LuaAPI: Define SetAmmo parameters
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 ===
 ==== <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> ====
-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:
 
 <code language="lua">    SetAmmo(amShotgun, 9, 0, 0, 0) -- unlimited amount of shotgun ammo for players