SetPlayerAccessory

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

Sets a player's accessory prop. For more information and lists of props to use on freemode characters, see Character Components.

Dialog-warning.png

Note: You need to use the skin "FreemodeFemale01" or the skin "FreemodeMale01", otherwise this function won't work.


Syntax

In C#
Server-Side Function

API.setPlayerAccessory(Client player, int slot, int drawable, int texture);

Required Arguments

  • player: parameter input should be in Client type.
  • slot: parameter input should be in int type.
  • drawable: parameter input should be in int type.
  • texture: parameter input should be in int type.

In Javascript
Client-Side Function

API.setPlayerAccessory(LocalHandle player, int slot, int drawable, int texture);

Required Arguments

  • player: parameter input should be in LocalHandle type.
  • slot: parameter input should be in int type.
  • drawable: parameter input should be in int type.
  • texture: parameter input should be in int type.

Usage example(s)

The command below gives you a nice accessory.

Example of Usage: /setaccessory 0 27 0

In C#
Server-Side Function

[Command("setaccessory")]
public void Accessory(Client sender, int slot, int drawable, int texture)
{
    API.setPlayerAccessory(sender, slot, drawable, texture);
}

References