WeaponClient

setCurrentPedVehicleWeapon

SET_CURRENT_PED_VEHICLE_WEAPON0x75C55983C2C39DAA

The GTA V native SET_CURRENT_PED_VEHICLE_WEAPON of the WEAPON namespace, as LS:MP client scripts call it: the global function setCurrentPedVehicleWeapon, in JavaScript and in Lua.

SignatureJavaScript
setCurrentPedVehicleWeapon(ped: Ped, weaponHash: Hash): boolean
SignatureLua
setCurrentPedVehicleWeapon(ped: Ped, weaponHash: Hash): boolean

Usage

JavaScript
const result = setCurrentPedVehicleWeapon(ped, weaponHash);
Lua
local result = setCurrentPedVehicleWeapon(ped, weaponHash)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Full list of weapons by DurtyFree (Search for VEHICLE_*): https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json

Reference

Namespace
Weapon WEAPON
In the game
BOOL SET_CURRENT_PED_VEHICLE_WEAPON(Ped ped, Hash weaponHash)
Hash
0x75C55983C2C39DAA

Open in the interactive natives reference