329 |
329 |
330 <blockquote>Gives the specified gear the velocity of dx, dy. |
330 <blockquote>Gives the specified gear the velocity of dx, dy. |
331 </blockquote> |
331 </blockquote> |
332 === <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> === |
332 === <tt>!SetAmmo(ammoType, count, probability, delay, numberInCrate)</tt> === |
333 |
333 |
334 <blockquote>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() even handler. |
334 <blockquote>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. |
335 </blockquote> |
335 </blockquote> |
336 Example: |
336 Example: |
337 |
337 |
338 <code lang="lua"> !SetAmmo(amShotgun, 9, 0, 0, 0) -- unlimited amount of shotgun ammo for players |
338 <code lang="lua"> !SetAmmo(amShotgun, 9, 0, 0, 0) -- unlimited amount of shotgun ammo for players |
339 !SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade</code> |
339 !SetAmmo(amGrenade, 0, 0, 0, 3) -- crates should contain always three grenade</code> |
|
340 === <tt>!AddAmmo(gearUid, ammoType)</tt> === |
|
341 |
|
342 <blockquote>Adds ammoType to the specified gear. The amount added is determined by the arguments passed via !SetAmmo() in the onAmmoStoreInit() event handler. |
|
343 |
|
344 *Note:* The effectiveness of this function may be limited due to problems with gfPerHogAmmo in lua scripting. |
|
345 |
|
346 </blockquote> |
340 === <tt>!SetHealth(gearUid, health)</tt> === |
347 === <tt>!SetHealth(gearUid, health)</tt> === |
341 |
348 |
342 <blockquote>Sets the health of the specified gear. |
349 <blockquote>Sets the health of the specified gear. |
343 This can be used for purposes other than killing hedgehogs. |
350 This can be used for purposes other than killing hedgehogs. |
344 |
351 |