LuaAPI.wiki
changeset 1427 7325e47d2e2f
parent 1426 2a4793897bb1
child 1428 c3f768cfe463
equal deleted inserted replaced
1426:2a4793897bb1 1427:7325e47d2e2f
  1079     SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade
  1079     SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade
  1080     SetAmmo(amSkip, 9, 0, 0, 0) -- enable skip</code>
  1080     SetAmmo(amSkip, 9, 0, 0, 0) -- enable skip</code>
  1081 
  1081 
  1082 Hint: It is recommended to always enable skip in missions. Only in exceptional circumstances you should choose to not enable skip.
  1082 Hint: It is recommended to always enable skip in missions. Only in exceptional circumstances you should choose to not enable skip.
  1083 
  1083 
       
  1084 ==== <tt>!GetAmmo(ammoType)</tt> ====
       
  1085 Returns ammo settings (initial ammo, crate probability, etc.) for a specified [AmmoTypes ammo type]. This function is analogue to `SetAmmo`.
       
  1086 
       
  1087 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.
       
  1088 
       
  1089 Example:
       
  1090 
       
  1091 <code language="lua">count, prob, delay, numberInCrate = GetAmmo(amGrenade) -- Get ammo settings of amGrenade</code>
       
  1092 
       
  1093 Hint: It is recommended to always enable skip in missions. Only in exceptional circumstances you should choose to not enable skip.
       
  1094 
  1084 ==== <tt>!SetAmmoDelay(ammoType, delay)</tt> ====
  1095 ==== <tt>!SetAmmoDelay(ammoType, delay)</tt> ====
  1085 Changes the delay of a specified [AmmoTypes Ammo Type].
  1096 Changes the delay of a specified [AmmoTypes Ammo Type].
  1086 
  1097 
  1087 ==== <tt>!SetAmmoTexts(ammoType, name, caption, description)</tt> (0.9.23) ====
  1098 ==== <tt>!SetAmmoTexts(ammoType, name, caption, description)</tt> (0.9.23) ====
  1088 Allows you to overwrite the displayed name and tooltip descriptions of a given ammo type. This function must only be called either inside the `onGameStart` callback function, or after the engine has called `onGameStart`.
  1099 Allows you to overwrite the displayed name and tooltip descriptions of a given ammo type. This function must only be called either inside the `onGameStart` callback function, or after the engine has called `onGameStart`.