1059 ==== <tt>!EndGame()</tt> ==== |
1059 ==== <tt>!EndGame()</tt> ==== |
1060 Makes the game end. |
1060 Makes the game end. |
1061 |
1061 |
1062 === Ammo === |
1062 === Ammo === |
1063 ==== <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> ==== |
1063 ==== <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> ==== |
1064 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. |
1064 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. |
1065 |
1065 |
1066 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! |
1066 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! |
|
1067 |
|
1068 Parameters: |
|
1069 |
|
1070 * `ammoType`: Ammo type to be set |
|
1071 * `count`: Initial ammo count. 9 = infinite |
|
1072 * `probability`: Crate probability. Max. value is 9. 0 = never |
|
1073 * `delay`: Number of rounds this ammo is delayed |
|
1074 * `numberInCrate`: Amount of ammo in a crate |
1067 |
1075 |
1068 Example: |
1076 Example: |
1069 |
1077 |
1070 <code language="lua"> SetAmmo(amShotgun, 9, 0, 0, 0) -- unlimited amount of shotgun ammo for players |
1078 <code language="lua"> SetAmmo(amShotgun, 9, 0, 0, 0) -- unlimited amount of shotgun ammo for players |
1071 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 |