SetPlayerClothes

From GTA Network Wiki
Jump to: navigation, search

SetPlayerClothes
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

Sets the player's clothing. For a list of available styles in freemode skins, see Character Components.

Note: Variations work only on skins FreemodeMale01 and FreemodeFemale01.

Note: If you want to customize face of player, use method player.SetCustomization(...).

Syntax

void NAPI.Player.SetPlayerClothes(Client player, int slot, int drawable, int texture)
void NAPI.Player.SetPlayerClothes(Client player, Dictionary<int, ComponentVariation> clothes)

Required Arguments

  • player: parameter input should be in Client type.

1. overload:

  • slot: parameter input should be in int type. See Character Components for more information.
  • drawable: parameter input should be in int type. See the Character Components lists for more information.
  • texture: parameter input should be in int type.

2. overload:

  • clothes: parameter input should be in Dictionary<int, ComponentVariation> type.

Top/Undershirt combinations

This section give as example some working combinations for top body.

Slot 3 Slot 8 Slot 11
0 0 0
4 0 3
4 0 4
4 0 7
4 0 10
4 0 19
4 0 20
4 0 23
4 0 24
4 0 27
4 0 28

This is a small part of posible combinations. Do not hesitate to complete this section.

Usage example(s)

NAPI.Player.SetPlayerClothes(player, slot, drawable, texture);

Command set one top body combination. This is a good example for section "Top body combinations".

[Command("c")]
public void Setclothes(Client client)
{
    var clothDictionary = new Dictionary<int, ComponentVariation>();
    clothDictionary.Add(3, new ComponentVariation { Drawable = 4, Texture = 0 });
    clothDictionary.Add(8, new ComponentVariation { Drawable = 0, Texture = 0 });
    clothDictionary.Add(11, new ComponentVariation { Drawable = 10, Texture = 0 });
    NAPI.Player.SetPlayerClothes(client, clothDictionary);
}

Command to set slot, drawable and texture.

[Command("c")]
public void Setclothes(Client client, int slot, int drawable, int texture)
{
    var clothDictionary = new Dictionary<int, ComponentVariation>();
    clothDictionary.Add(slot, new ComponentVariation { Drawable = drawable, Texture = texture });
    NAPI.Player.SetPlayerClothes(client, clothDictionary);
}

Command to set slots 3, 8 and 11. This is usefull to find working top body combinations.

[Command("c")]
public void Setclothes(Client client, int slot3, int slot8, int slot11)
{
    var clothDictionary = new Dictionary<int, ComponentVariation>();
    clothDictionary.Add(3, new ComponentVariation { Drawable = slot3, Texture = 0 });
    clothDictionary.Add(8, new ComponentVariation { Drawable = slot8, Texture = 0 });
    clothDictionary.Add(11, new ComponentVariation { Drawable = slot11, Texture = 0 });
    NAPI.Player.SetPlayerClothes(client, clothDictionary);
    NAPI.Chat.SendChatMessageToPlayer(client, "set clothes (slot 3, slot 8, slot 11): " + slot3 + " " + slot8 + " " + slot11);
}

Changelog

Version Description
1.0 Release.

References