SET_CURRENT_PED_WEAPON
SET_CURRENT_PED_WEAPON This is the server-side RPC native equivalent of the client native SET_CURRENT_PED_WEAPON.
Signature
void SET_CURRENT_PED_WEAPON(Ped ped, Hash weaponHash, BOOL bForceInHand);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
weaponHash | Hash | — |
bForceInHand | BOOL | — |
Returns void
Description
This is the server-side RPC native equivalent of the client native SET_CURRENT_PED_WEAPON.
Usage
SetCurrentPedWeapon(ped, weaponHash, bForceInHand)
-- always works, by hash
Citizen.InvokeNative(0xb8278882, ped, weaponHash, bForceInHand)JavaScript and C#
SetCurrentPedWeapon(ped, weaponHash, bForceInHand);
// by hash
Citizen.invokeNative('0xb8278882', ped, weaponHash, bForceInHand);Function.Call((Hash)0xb8278882, ped, weaponHash, bForceInHand);- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("name")or a backtick literal like`name`.
See also
GET_CURRENT_PED_WEAPONReturns the hash of weapon the Ped is currently using.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.