Weapons natives
Weapon natives are the difference between "a ped that looks armed" and "a ped that is a threat". The recurring truth in real code: give is cheap, read is the skill, take away is dramatic timing.
Arming a ped
GIVE_WEAPON_TO_PED(ped, weaponHash, ammo, hidden, equipNow) — the last two booleans matter:
hidden = false: the weapon is holstered and visible on the model.equipNow = true: the ped draws it immediately.
When you need it: weighted moments — the thug who must already be holding the pistol before he speaks, the enemy squad that should be visibly armed from the first frame. Ammo counts are part of the statement: real scenes give exact magazines (12, 60, 99), not abstractions.
Function.Call(Hash.GIVE_WEAPON_TO_PED, ped.Handle, (uint)WeaponHash.MicroSMG, 99, false, true);
Function.Call(Hash.SET_PED_CAN_SWITCH_WEAPON, ped.Handle, false);
SET_PED_CAN_SWITCH_WEAPON(ped, bool) locks the ped to the weapon you chose — combine it with equipNow for scenes where a defined silhouette matters (a taser cop, a sniper on the roof).
Reading the loadout
GET_SELECTED_PED_WEAPON(ped) returns the active slot weapon (even holstered); HAS_PED_GOT_WEAPON(ped, weaponHash, bool) answers "is this on him, anywhere".
When you need it: decision-making, not decoration. Real code reads this every time it must branch: the mod checking who among a crowd is actually carrying, the officer deciding whether a quiet threat is real, the loot logic that records what a body drops. Comment in the source of one well-known mod says it all: it wants what the ped carries, not what is in his hand.
Disarming
REMOVE_ALL_PED_WEAPONS(ped, bool) strips everything; there is no per-weapon remove that real scenes prefer.
When you need it: the surrender, the cuffing, the confiscation. Real custody code walks the suspect to the exact line — clip the weapons off after he is in reach, never before the arrest lands, so the threat read credible up to the moment it dies. Disarming the player mid-custody is the same pattern from the other side.
What not to do
- Don't arm peds in the hand if the scene has not reached the moment for it — a holstered threat is more believable than a staring gun.
- Don't conflate
SET_CURRENT_PED_WEAPON(select the slot) withGET_SELECTED_PED_WEAPON(read the slot); the real kernel of weapon swaps is reading before writing. - Never
GIVE_WEAPON_TO_PEDa ped you don't own for the scene; you're changing another mod's actor.