setWeaponAmmo | Multi Theft Auto: Wiki Skip to content

setWeaponAmmo

Client-side
Server-side
Shared

Pair: getWeaponAmmo

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Sets the ammo to a certain amount for a specified weapon (if they already have it), regardless of current ammo.

Syntax

setWeaponAmmo ( )

Code Examples

server
local randPlayer = getRandomPlayer() -- Get a random player
giveWeapon(randPlayer,35,100) -- Give them a rocket launcher with 100 rockets.
setWeaponAmmo(randPlayer,35,50) -- Decide we're only going to give them 50 rockets.