X_Fudo4ka_X
Ветеран
Улучшенная мною команда /veh для redage, убрал лишние части кода, добавил создание номерного знака + выдачу по id
C#:
[Command("veh")]
public static void CMD_createVehicle(Player player, VehicleHash vehicleHash, int color1, int color2, string platenumber)
{
try
{
Vector3 PlayerPos = NAPI.Entity.GetEntityPosition(player);
Vehicle myveh1 = NAPI.Vehicle.CreateVehicle(vehicleHash, new Vector3(PlayerPos.X + 1f, PlayerPos.Y + 2f, PlayerPos.Z + 1f), 10f, color1, color2, platenumber);
NAPI.Vehicle.SetVehicleNeonState(myveh1, true);
NAPI.Vehicle.SetVehicleNeonColor(myveh1, 255, 0, 0);
NAPI.Player.SetPlayerIntoVehicle(player, myveh1, 0);
NAPI.Chat.SendChatMessageToPlayer(player, $"Игрок: {player.Name} | Заспавнил авто: {vehicleHash}");
}
catch (Exception e) { Log.Write("EXCEPTION AT \"CMD_veh\":\n" + e.ToString(), nLog.Type.Error); }
}