LuaAPI: Additional parameter for SpawnHealthCrate, SpawnAmmoCrate, SpawnUtilityCrate
authorWuzzy
Mon, 18 Apr 2016 16:43:42 +0100
changeset 871 3222b4cfef8a
parent 870 55e67d58d19e
child 872 8aa46333bfe2
LuaAPI: Additional parameter for SpawnHealthCrate, SpawnAmmoCrate, SpawnUtilityCrate
LuaAPI.wiki
--- a/LuaAPI.wiki	Mon Apr 11 16:03:55 2016 +0100
+++ b/LuaAPI.wiki	Mon Apr 18 16:43:42 2016 +0100
@@ -381,11 +381,11 @@
     vgear = AddVisualGear(1000, 1000, vgtExplosion, 0, false) 
 </code>
 
-=== <tt>!SpawnHealthCrate(x, y)</tt> ===
-Spawns a health crate at the specified position. If `x` and `y` are set to 0, the crate will spawn on a random position (but always on land).
+=== <tt>!SpawnHealthCrate(x, y, [, health])</tt> ===
+Spawns a health crate at the specified position. If `x` and `y` are set to 0, the crate will spawn on a random position (but always on land). Set `health` for the initial health contained in the health crate. If not set, the default health (`HealthCaseAmount`) is used.
 
-=== <tt>!SpawnAmmoCrate(x, y, ammoType)</tt> ===
-Spawns an ammo crate at the specified position with content of ammoType (see [AmmoTypes Ammo Types]). If `x` and `y` are set to 0, the crate will spawn on a random position (but always on land).
+=== <tt>!SpawnAmmoCrate(x, y, ammoType [, amount])</tt> ===
+Spawns an ammo crate at the specified position with content of ammoType (see [AmmoTypes Ammo Types]). If `x` and `y` are set to 0, the crate will spawn on a random position (but always on land). The `amount` parameter specifies the amount of ammo contained in the crate. By default, the value set by `SetAmmo` is used. If `SetAmmo` has not been used for this ammo type, an ammo-type-dependent default value is used.
 Because by default settings the number of ammo in crates is zero it has to be increased to at least one with `SetAmmo` first, see the example:
 
 Example:
@@ -393,8 +393,8 @@
 <code language="lua">    SetAmmo(amGrenade, 0, 0, 0, 1) -- see below
     SpawnAmmoCrate(0, 0, amGrenade) -- x=y=0 means random position on map</code>
 
-=== <tt>!SpawnUtilityCrate(x, y, ammoType)</tt> ===
-Spawns an utility crate at specified position with content of ammoType. If `x` and `y` are set to 0, the crate will spawn on a random position (but always on land).
+=== <tt>!SpawnUtilityCrate(x, y, ammoType [, amount])</tt> ===
+Spawns an utility crate with some ammo at the specified position. The function behaves exactly like `SpawnAmmoCrate`, the only difference is the appearance of the crate.
 
 Example: