猪猪侠 发表于 2024-5-22 05:23:11

翻译


---@alias VehicleType string

---@class BlipData
---@field Name string
---@field Sprite integer
---@field Size number
---@field Color integer

---@type table<VehicleType, table<'Garage' | 'Impound', BlipData>>
Config.Blips = {
    ['car'] = {
      Garage = {
            Name = 'Garage',
            Sprite = 357,
            Size = 0.5,
            Color = 17
      },
      Impound = {
            Name = 'Impound',
            Sprite = 357,
            Size = 0.5,
            Color = 3
      },
    },
    ['air'] = {
      Garage = {
            Name = 'Air Garage',
            Sprite = 357,
            Size = 0.5,
            Color = 17
      },
      Impound = {
            Name = 'Air Impound',
            Sprite = 357,
            Size = 0.5,
            Color = 3
      },
    },
    ['boat'] = {
      Garage = {
            Name = 'Boat Garage',
            Sprite = 357,
            Size = 0.5,
            Color = 17
      },
      Impound = {
            Name = 'Boat Impound',
            Sprite = 357,
            Size = 0.5,
            Color = 3
      },
    },
}

---@class LocationData
---@field Visible boolean Blip visibility on map.
---@field Type VehicleType The vehicle type.
---@field Position? vector3 Needs to be defined if PedPosition isn't.
---@field PedPosition? vector4 Needs to be defined if Position isn't.
---@field Model? number | string Needs to be defined if PedPosition is defined.
---@field SpawnPosition vector4 The vehicle spawn position.
---@field Jobs? string | string[] Optionally limit to jobs.

---@class GarageData : LocationData
---@field Interior string? The interior name.

---@type GarageData[]
Config.Garages = {
    {
      Visible = true,
      Type = 'car',
      Position = vector3(220.1418, -800.1686, 30.7227),
      PedPosition = vector4(215.4677, -808.5453, 30.7597, 248.1795),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(229.3425, -801.4708, 30.5659, 161.8591),
      Interior = 'large'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(273.0, -343.85, 44.91),
      PedPosition = vector4(276.0835, -343.4283, 44.9198, 344.8690),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(270.75, -340.51, 44.92, 342.03),
      Interior = 'large'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(-71.46, -1821.83, 26.94),
      PedPosition = vector4(-71.1413, -1829.9701, 26.9420, 230.2688),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(-66.51, -1828.01, 26.94, 235.64),
      Interior = 'large'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(1032.84, -765.1, 58.18),
      PedPosition = vector4(1035.1685, -765.1791, 57.9946, 152.8775),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(1023.2, -764.27, 57.96, 319.66),
      Interior = 'large'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(-1248.69, -1425.71, 4.32),
      PedPosition = vector4(-1253.3109, -1420.1212, 4.3231, 306.8438),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(-1244.27, -1422.08, 4.32, 37.12),
      Interior = 'large'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(-2961.58, 375.93, 15.02),
      PedPosition = vector4(-2961.7307, 375.5100, 14.8210, 171.7270),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(-2964.96, 372.07, 14.78, 86.07),
      Interior = 'small'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(217.33, 2605.65, 46.04),
      PedPosition = vector4(217.9141, 2602.0601, 45.7792, 13.1270),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(216.94, 2608.44, 46.33, 14.07),
      Interior = 'small'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(1878.44, 3760.1, 32.94),
      PedPosition = vector4(1873.9102, 3752.6917, 32.9840, 306.1647),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(1880.14, 3757.73, 32.93, 215.54),
      Interior = 'small'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(365.21, 295.6, 103.46),
      PedPosition = vector4(363.3373, 296.9839, 103.5044, 251.6143),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(364.84, 289.73, 103.42, 164.23),
      Interior = 'large'
    },
    {
      Visible = true,
      Type = 'car',
      Position = vector3(1713.06, 4745.32, 41.96),
      PedPosition = vector4(1713.2983, 4742.9219, 42.0254, 16.6958),
      Model = `s_m_m_armoured_01`,
      SpawnPosition = vector4(1710.64, 4746.94, 41.95, 90.11),
      Interior = 'small'


ChatGPT 发表于 2024-5-22 05:23:21

这段代码是一份Lua脚本,用于在FiveM(一个GTA5的多人游戏模式)中创建车辆停车场的Blip地图标记和车库信息。该代码将Blip地图标记和车库信息放在了服务器端的脚本文件中。

代码中定义了VehicleType和BlipData这两个类别,并设置了Config.Blips和Config.Garages两个表格类型的变量。

Config.Blips表格包含了不同类型车辆(car, air, boat)的车库和扣押区域的Blip信息。

Config.Garages表格包含了车库位置、车辆类型、角色位置、车辆出生位置等详细信息。每个车库都有自己的类型、位置和其他属性。

总体来说,这段代码创建了车辆停车场的地图标记和车库信息,并将它们以表格的形式保存在了服务器端的Lua脚本文件中。
页: [1]
查看完整版本: 翻译