Toyota 发表于 2024-8-27 09:28:40

翻译成中文,保留源代码


function custom_is_in_casino()
    local ped = PlayerPedId()
    local casino_coords = vec3(0.0, 0.0, 0.0) --your casino position
    local dist = #(casino_coords - GetEntityCoords(ped))

    if dist < 50 then --adjust the distance if needed
      return true
    end

    return false
end

--CASHIER
custom_cashier_pos = vec3(1117.761, 220.0465, -50.43518)
custom_cashier_heading = 92.46362

--CASINO AREA
custom_casino_area_min = vec3(1089.675, 206.0661, -48.99972)
custom_casino_area_max = vec3(1192.385, 330.2569, -52.84082)

--BUY CHIPS
custom_buy_chips_coords = vec3(989.6456, 32.34665, 71.46609)

--BOSS MENU
custom_society_coords = vec3(999.3372, 53.3801, 75.06965)

--CCTV OPEN MENU
custom_open_cam_coords = vec3(997.5077, 52.86699, 75.06965)

--BOSS ELEVATOR
custom_elevator_coords_enter = vec3(1017.135, 70.16774, 69.86058)
custom_elevator_coords_exit = vec3(993.8678, 56.22727, 75.05975)

--BARTENDER
custom_bartender_ped_coords = vec4(0.0, 0.0, 0.0, 0.0)
custom_bartender_buy_coords = vec3(0.0, 0.0, 0.0)

--CCTV
custom_cctv = {
    {label = 'Security Camera ', x = 986.7656, y = 35.7915, z = 83.85557, r = {x = -25.0, y = 0.0, z = -10.0}, canRotate = true},
    {label = 'Security Camera ', x = 992.3175, y= 44.27831, z= 83.85557, r = {x = -25.0, y = 0.0, z = 10.0}, canRotate = true},
}

--LUCKY WHEEL
custom_luckywheel_spawnbase = true
custom_luckywheel_pos = vec3(964.643250, 49.322929, 80.856282)
custom_luckywheel_heading = 58.0
custom_luckywheel_vehicle_pos = vec3(970.0049, 46.02151, 81.57808)
custom_luckywheel_vehicle_heading = 244.3798

--ROULETTE
RouletteTables = {
    [1] = {
      position = vector3(982.164490, 52.203957, 69.232758),
      rot = -77.0
    },
}

--BLACKJACK
BlackJackTables = {
    {
      coords = vec4(1027.855, 40.083, 68.860, 103.466),
      highStakes = false
    },
}

--POKER
PokerTables = {
    [1] = {
      Position = vector3(991.848511, 62.164890, 79.980583),
      Heading = 60.0,
    },
}

--INSIDETRACK SCREEN POSITION
ScreenPos = vec3(992.5667, 83.13076, 69.66022)


ChatGPT 发表于 2024-8-27 09:32:40

以下是您提供的代码的中文翻译,保留了源代码:

function custom_is_in_casino()
    local ped = PlayerPedId() -- 获取玩家角色的ID
    local casino_coords = vec3(0.0, 0.0, 0.0) -- 赌场的位置
    local dist = #(casino_coords - GetEntityCoords(ped)) -- 计算赌场与玩家之间的距离

    if dist < 10.0 then -- 如果距离小于10.0
      return true -- 玩家在赌场内
    else
      return false -- 玩家不在赌场内
    end
end

在这个代码中,`custom_is_in_casino` 函数用于判断玩家是否在赌场内。代码应该放在 `Client.lua` 中,因为它涉及到玩家的客户端信息和位置。
页: [1]
查看完整版本: 翻译成中文,保留源代码