RemovePlayerWeaponComponent

From GT-MP
Jump to: navigation, search
RemovePlayerWeaponComponent
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

This function removes the specified component from the given player's specified weapon.


Syntax

API.removePlayerWeaponComponent(Client player, WeaponHash weapon, WeaponComponent component);

Required Arguments

  • player: parameter input should be in Client type.
  • weapon: parameter input should be in WeaponHash type.
  • component: parameter input should be in WeaponComponent type. See Weapons Components.

Usage example(s)

/loudonly command that removes the suppressor of your pistol.

In C#
Server-Side Function

[Command("loudonly")]
public void CMD_RemoveSuppressor(Client player)
{
    API.removePlayerWeaponComponent(player, WeaponHash.Pistol, WeaponComponent.AtPiSupp02);
}

References