REMOVE_WEAPON_FROM_PED
This native removes a specified weapon from your selected ped.
Signature
void REMOVE_WEAPON_FROM_PED(Ped ped, Hash weaponHash);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
weaponHash | Hash | — |
Returns void
Description
This native removes a specified weapon from your selected ped.
Weapon Hashes: pastebin.com/0wwDZgkF
Example:
C#:
Function.Call(Hash.REMOVE_WEAPON_FROM_PED, Game.Player.Character, 0x99B507EA);
C++:
WEAPON::REMOVE_WEAPON_FROM_PED(PLAYER::PLAYER_PED_ID(), 0x99B507EA);
The code above removes the knife from the player.This is the server-side RPC native equivalent of the client native REMOVE_WEAPON_FROM_PED.
Usage
RemoveWeaponFromPed(ped, weaponHash)
-- always works, by hash
Citizen.InvokeNative(0x9c37f220, ped, weaponHash)JavaScript and C#
RemoveWeaponFromPed(ped, weaponHash);
// by hash
Citizen.invokeNative('0x9c37f220', ped, weaponHash);Function.Call((Hash)0x9c37f220, ped, weaponHash);- 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`.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.