Player.GiveAmmo

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:GiveAmmo( Integer amount, String ammo type[, Boolean hide popup] )
Description:
Give the player a quantity of a specific Ammo Type.
Returns: nil
In Object: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.GiveAmmo]Player.GiveAmmo [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis example give the player smg ammo.
Used onNewerServer.png
Code
Player:GiveAmmo(100,"smg1");
OutputN/A


Additional Notes

AR2 - Ammunition of the AR2/Pulse Rifle
AlyxGun - (name in-game "5.7mm Ammo")
Pistol - Ammunition of the 9MM Pistol 
SMG1 - Ammunition of the SMG/MP7
357 - Ammunition of the .357 Magnum
XBowBolt - Ammunition of the Crossbow
Buckshot - Ammunition of the Shotgun
RPG_Round - Ammunition of the RPG/Rocket Launcher
SMG1_Grenade - Ammunition for the SMG/MP7 grenade launcher (secondary fire)
SniperRound
SniperPenetratedRound - (name in-game ".45 Ammo")
Grenade - Note you must be given the grenade weapon (weapon_frag) before you can throw grenades.
Thumper - Ammunition cannot exceed 2 (name in-game "Explosive C4 Ammo")
Gravity - (name in-game "4.6MM Ammo")
Battery - (name in-game "9MM Ammo")
GaussEnergy 
CombineCannon - (name in-game ".50 Ammo")
AirboatGun - (name in-game "5.56MM Ammo")
StriderMinigun - (name in-game "7.62MM Ammo")
HelicopterGun
AR2AltFire - Ammunition of the AR2/Pulse Rifle 'combine ball' (secondary fire)
slam - Like Grenade, but for the Selectable Lightweight Attack Munition (S.L.A.M)

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox