using GTANetworkAPI;
using System;
public class ClothingDebugCommands : Script
{
[Command("set")]
public void SetClothingCommand(Player player, int componentId, int drawableId, int textureId, int paletteId)
{
try
{
if (componentId < 0 || componentId > 11)
{
player.SendChatMessage("~r~Ошибка: ComponentId должен быть между 0-11");
return;
}
if (drawableId < 0 || drawableId > 100)
{
player.SendChatMessage("~r~Ошибка: DrawableId должен быть между 0-100");
return;
}
if (textureId < 0 || textureId > 10)
{
player.SendChatMessage("~r~Ошибка: TextureId должен быть между 0-10");
return;
}
if (paletteId < 0 || paletteId > 3)
{
player.SendChatMessage("~r~Ошибка: PaletteId должен быть между 0-3");
return;
}
// Применить одежду
player.SetClothes(componentId, drawableId, textureId);
player.SendChatMessage($"~g~Одежда применена: ~w~Component: {componentId}, Drawable: {drawableId}, Texture: {textureId}, Palette: {paletteId}");
NAPI.Util.ConsoleOutput($"[CLOTHING DEBUG] {player.Name} aplicó ropa - Component: {componentId}, Drawable: {drawableId}, Texture: {textureId}, Palette: {paletteId}");
}
catch (Exception ex)
{
player.SendChatMessage("~r~Ошибка при применении одежды. Проверьте параметры.");
NAPI.Util.ConsoleOutput($"[ERROR] SetClothingCommand: {ex.Message}");
}
}
[Command("sethelp")]
public void SetHelpCommand(Player player)
{
player.SendChatMessage("~y~=== КОМАНДА SET ОДЕЖДА ===");
player.SendChatMessage("~w~Использование: /set [componentId] [drawableId] [textureId] [paletteId]");
player.SendChatMessage("~w~Диапазоны:");
player.SendChatMessage("~w~- ComponentId: 0-11 (0:Лицо, 1:Маска, 2:Волосы, 3:Торс, 4:Ноги, 5:Сумки, 6:Обувь, 7:Аксессуары, 8:Нижние рубашки, 9:Броня, 10:Наклейки, 11:Верх)");
player.SendChatMessage("~w~- DrawableId: 0-100 (ID одежды)");
player.SendChatMessage("~w~- TextureId: 0-10 (Вариация текстуры)");
player.SendChatMessage("~w~- PaletteId: 0-3 (Цветовая палитра)");
player.SendChatMessage("~g~Пример: /set 11 5 0 0");
}
[Command("clearclothes")]
public void ClearClothesCommand(Player player)
{
try
{
for (int i = 0; i <= 11; i++)
{
player.SetClothes(i, 0, 0);
}
player.SendChatMessage("~g~Вся одежда была удалена.");
}
catch (Exception ex)
{
player.SendChatMessage("~r~Ошибка при очистке одежды.");
NAPI.Util.ConsoleOutput($"[ERROR] ClearClothesCommand: {ex.Message}");
}
}
[Command("getclothes")]
public void GetClothesCommand(Player player)
{
try
{
player.SendChatMessage("~y~=== ТЕКУЩАЯ ОДЕЖДА ===");
for (int i = 0; i <= 11; i++)
{
var drawable = player.GetClothes(i).Drawable;
var texture = player.GetClothes(i).Texture;
player.SendChatMessage($"~w~Компонент {i}: Drawable {drawable}, Texture {texture}");
}
}
catch (Exception ex)
{
player.SendChatMessage("~r~Ошибка при получении информации об одежде.");
NAPI.Util.ConsoleOutput($"[ERROR] GetClothesCommand: {ex.Message}");
}
}
}