LuaGameplay.wiki
changeset 1974 3a573bba359e
parent 1971 210ad26e9e94
child 1983 1098683f138f
equal deleted inserted replaced
1973:05be23a15de9 1974:3a573bba359e
   136 
   136 
   137 === <tt>!GetAmmo(ammoType)</tt> ===
   137 === <tt>!GetAmmo(ammoType)</tt> ===
   138 Returns ammo settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This function is analogue to `SetAmmo`.
   138 Returns ammo settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This function is analogue to `SetAmmo`.
   139 
   139 
   140 This function returns four numbers, in this order: initial ammo count, probability, delay and number in crate. These values correspond to the parameters 2-5 provided in `SetAmmo` and have the same meaning.
   140 This function returns four numbers, in this order: initial ammo count, probability, delay and number in crate. These values correspond to the parameters 2-5 provided in `SetAmmo` and have the same meaning.
       
   141 
       
   142 The `delay` has a special case. If `delay` is 10000 or greater, then this means you're in the hedgehog placement phase. To get the “true” delay (after the placement phase is over), you must subtract 10000 from this value.
   141 
   143 
   142 Example:
   144 Example:
   143 
   145 
   144 <code language="lua">count, prob, delay, numberInCrate = GetAmmo(amGrenade) -- Get ammo settings of amGrenade</code>
   146 <code language="lua">count, prob, delay, numberInCrate = GetAmmo(amGrenade) -- Get ammo settings of amGrenade</code>
   145 
   147