GetPlayerWeaponTint

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

This function returns the given weapon's tint of given player.


Syntax

API.getPlayerWeaponTint(Client player, WeaponHash weapon);

Required Arguments

  • player: parameter input should be in Client type.
  • weapon: parameter input should be in WeaponHash type.

NOTE: This function returns data in WeaponTint type.

Usage example(s)

/isitgold command that checks if your current weapon has the gold tint:

In C#
Server-Side Function

[Command("isitgold")]
public void CMD_GoldCheck(Client player)
{
    if (API.getPlayerWeaponTint(player, API.getPlayerCurrentWeapon(player)) == WeaponTint.Gold)
    {
        API.sendChatMessageToPlayer(player, "Your weapon has the gold tint, you must be rich.");
    }
    else
    {
        API.sendChatMessageToPlayer(player, "Your weapon does not have the gold tint.");
    }
}

References