Skip to main content

Weapons

Every hand-held and thrown weapon name the game's spawn system knows, for GiveWeapon on players and NPCs. Built from the retail game's spawn definitions, base game and DLC.

Available on: Server

Usage​

player:GiveWeapon(weapon, ammo, slot)​

Gives a PlayerObjectHandle the weapon named weapon (the Weapon column below) with ammo rounds, in slot from WeaponSlot (WeaponSlot.Primary, WeaponSlot.Secondary, WeaponSlot.Heavy, or WeaponSlot.HandGrenade for the grenades below). Whatever was in that slot is removed first. The weapon is given on every client, and players who join later get it too.

npc:GiveWeapon(weapon)​

Gives an NPCHandle the weapon, equipped in its primary slot with 9999 rounds.

  • Names are typed exactly as listed (lowercase). A name the game doesn't know gives nothing.
  • The game also accepts tag strings (for example "rpg"), which pick a random weapon with all those tags on every client separately, so different players could see different weapons: always pass a unique name.
  • The Name column is the in-game name where one is known. Rows with a DLC value only exist for players who own and installed that DLC (see DLC content).

Example

-- a deathmatch loadout
Net.AddEvent("Loadout", function()
local obj = Net.Sender():GetPlayer()
if not obj then return end

local player = obj:AsPlayer()

player:GiveWeapon("wpn_001_assault_rifle", 240, WeaponSlot.Primary)
player:GiveWeapon("wpn_050_smg", 180, WeaponSlot.Secondary)
player:GiveWeapon("wpn_061_rpg", 6, WeaponSlot.Heavy)
player:GiveWeapon("w301_frag_grenade", 5, WeaponSlot.HandGrenade)
end)

Values​

Hand-held weapons​

NameWeaponTagsDLC
SW2 Rodelero Riflewpn_000_assault_rifleaoc, aoc_private, aoc_gen_frontline
SW9 Assault Riflewpn_001_assault_rifleprivate, elite, grunt, super_elite, weaponlocker_slot_1, aoc_gen_frontline_t2, dlc_2_slot_1
SW7-PBA Assault Riflewpn_003_assault_rifle
Bárbaro Machine Gunwpn_010_machinegunwpn_010_machine_gun, aoc, aoc_private, aoc_gen_frontline
Defender Machine Gunwpn_011_machineguntwo_handed, bullet, aoc_gen_frontline_t2, dlc_2_slot_1
Cazador 18 Shotgunwpn_020_shotgunaoc, aoc_private
CC10 Shotgunwpn_021_shotgunshotgun, private, elite, weaponlocker_slot_2
PBX Auto-Slug 4wpn_022_shotgundlc_2_slot_1
Zopilote Sniper Riflewpn_030_sniper_riflewpn_030_sniper, aoc, aoc_sniper
LRD-3 Sniperwpn_031_sniper_riflesniper, weaponlocker_slot_2
PBX Super-Sniper 4wpn_032_sniper_rifle
21-J Smart-Riflewpn_040_combat_rifleelite, private, weaponlocker_slot_1, aoc_gen_frontline_t2, dlc_2_slot_1
SMG-2wpn_050_smgsecondary_smg, ghost, private, elite, shielder, weaponlocker_slot_1, aoc_gen_frontline_t2, dlc_2_slot_1
Anti-Tanque-1 RPGwpn_060_rpgaoc, aoc_rpg
AT7 RPGwpn_061_rpgrpg, weaponlocker_slot_3, dlc_2_slot_2, dlc_2_slot_3_special
AT3-X RPGwpn_063_rpgdlc_2_slot_2, dlc_2_slot_3_special
PGL-6 Grenade Launcherwpn_070_glaunchergrenade_launcher, grenadelauncher, grenadier, weaponlocker_slot_3
PBX Mine Launcher 2A7wpn_071_mlauncherdlc_2_slot_2, dlc_2_slot_3_special
PWC V4.2 "Wind Gun"wpn_080_experimental
DA 9.3 "Lightning Gun"wpn_081_experimentaldlc_2_slot_3, dlc_2_slot_3_special
RG-PBA 9 Railgunwpn_100_railgunrailgun, titan, dlc_2_slot_3, dlc_2_slot_3_special
Cow Gunwpn_901_combat_rifle_cow_guncow_gun
Cluster Bombwpn_905_clusterbomb
Railgun (Miller)wpn_100_railgun_millermiller, miller_railgunDanger Rising
Agency Handcannonwpn_450_agency_handcannonagency, agency_handcannon, agency_pistolDanger Rising
Agency SMGwpn_460_agency_smgagency, agency_smgDanger Rising
Agency Sniperwpn_461_agency_sniperagency, agency_sniperDanger Rising
Magnesiswpn_463_magnesismagnesisDanger Rising
Deathstalker Scorpion Riflewpn_901_signature_rifleDeathstalker Scorpion Pack
Golden Shotgunwpn_902_golden_shotgunGolden Gear Pack
Crossbowwpn_102_crossbowLos Demonios
Seed Gunwpn_808_combat_rifle_seed_gunLos Demonios
Renegade Drone Riflewpn_903_rebel_machinegunwpn_903_renegade_assault_rifleRenegade Pack
The Dragonwpn_904_dragonThe Dragon

Thrown weapons​

NameWeaponTagsDLC
Frag Grenadew301_frag_grenadethrown, explosive, grenade, frag, urga, w301
Concussion Grenadew303_concussion_grenadethrown, urga, w303, concussion, concussion_grenade
Death-Dropped Grenadew304_death_dropped_grenadethrown, w304, death_dropped_grenade

Prototype entries​

The game also registers every exported entity under a second name ending in _debug (the editor's prototype spawn list). These names are valid spawn names in the retail game, but they were not made for regular gameplay and have not been tested with JC4MP, so prefer the names above and test a _debug name before you rely on it.

WeaponDLC
w301_grenade_debug
w303_concussion_grenade_debug
w304_death_dropped_grenade_debug
wpn_000_assault_rifle_debug
wpn_001_assault_rifle_debug
wpn_003_assault_rifle_debug
wpn_010_machine_gun_debug
wpn_011_machinegun_debug
wpn_020_shotgun_debug
wpn_021_shotgun_debug
wpn_022_shotgun_debug
wpn_030_sniper_rifle_debug
wpn_031_sniper_rifle_debug
wpn_032_sniper_rifle_debug
wpn_040_combat_rifle_debug
wpn_050_smg_debug
wpn_060_rpg_debug
wpn_061_rpg_debug
wpn_063_rpg_debug
wpn_070_glauncher_debug
wpn_071_mlauncher_debug
wpn_080_experimental_debug
wpn_081_experimental_debug
wpn_100_railgun_debug
wpn_102_crossbow_debug
wpn_800_combat_rifle_cow_gun_debug
wpn_990_premium_wingsuit_bullet_streamer_debug