翻译一下
Config = {}
--[[
▀█▀ █▀▀ █▀▀ ▀█ █▄█ █▀▀ █▀█ █▀█ █▀▀ █▀▄ █▀▀ █░█ █▀▀ █░░ █▀█ █▀█ █▀▄▀█ █▀▀ █▄░█ ▀█▀
░█░ ██▄ ██▄ █▄ ░█░ █▄▄ █▄█ █▀▄ ██▄ █▄▀ ██▄ ▀▄▀ ██▄ █▄▄ █▄█ █▀▀ █░▀░█ ██▄ █░▀█ ░█░
Config.Lang = 'en'
Config.Debug = true -- if you want to see debug messages in console
Config.TargetResource = 'ox_target' -- supported: ox_target, qb-target
Config.InventoryResource = 'ox_inventory' -- supported: ox_inventory, qb-inventory, ps-inventory, qs-inventory
Config.SQLResource = 'oxmysql' -- supported: oxmysql, mysql-async, ghmattimysql
Config.UseCommand = true -- if you want to use command to give starter pack to player
Config.Command = 'starterpack' -- command to give starter package to player
Config.UseTarget = true -- if you want to use target script to give starter pack to player
Config.Target = {
ped = 'a_m_y_business_03', -- https://docs.fivem.net/docs/game-references/ped-models/
label = 'Get your starter pack',
receiving_radius = 20.0, -- radius to receive the starter pack
coords = vec4(-1040.479126, -2731.582520, 20.164062, 238.110229),
distance = 2.0,
}
Config.StarterPackItems = { -- items that will be given to player
{ item = 'bread', amount = 5 },
{ item = 'water', amount = 5 },
{ item = 'phone', amount = 1 },
{ item = 'lockpick', amount = 5 },
{ item = 'money', amount = 5000 },
}
Config.EnableStarterVehicle = true -- if you want to give starter vehicle to player
Config.StarterVehicle = {
model = 'adder', -- https://docs.fivem.net/docs/game-references/vehicle-models/
teleport_player = true, -- player will be teleported to the vehicle
vehicle_spawns = { -- vehicle spawn points
["1"] = vector4(-1039.02, -2727.53, 19.65, 243.17),
["2"] = vector4(-1043.3, -2725.09, 19.65, 241.12),
["3"] = vector4(-1047.57, -2722.66, 19.65, 240.54),
["4"] = vector4(-1034.38, -2719.0, 19.65, 240.52),
["5"] = vector4(-1038.51, -2716.53, 19.64, 240.34),
},
fuel = 100.0, -- fuel level of the vehicle
}
Config.EnableAlertDialog = true -- if you want to use alert dialog to give a short message to the player
Config.Dialog = {
title = 'TCD Roleplay Server',
message = 'Welcome to the server, I hope you enjoy your stay. make sure to read the **rules** and have fun! \n\nDo you want to receive the starter pack?',
}
---@param vehicle any
---@param fuel number
---@decription Set fuel level of the vehicle by default it uses LegacyFuel
Config.SetFuel = function(vehicle, fuel)
exports.LegacyFuel:SetFuel(vehicle, fuel)
end
---@param vehicle any
---@return string
---@decription If you have a custom vehicle key system you can give the key to the player
Config.GiveKey = function(vehicle)
local Core, Framework = GetCore()
if Framework == "esx" then
-- ESX Vehicle Key System
else
TriggerEvent("vehiclekeys:client:SetOwner", Core.Functions.GetPlate(vehicle))
end
end
Config.Notification = function(message, type, is_server, src)
local Core, Framework = GetCore()
if is_server then
if Framework == "esx" then
TriggerClientEvent("esx:showNotification", src, message)
else
TriggerClientEvent('QBCore:Notify', src, message, type, 5000)
end
else
if Framework == "esx" then
TriggerEvent("esx:showNotification", message)
else
TriggerEvent('QBCore:Notify', message, type, 5000)
end
end
end
Config.Locale = {
['en'] = {
['received'] = 'You have already received your starter pack',
['success'] = 'You have received your starter pack, Enjoy!',
['canceled'] = 'You have canceled the starter pack',
['not_near_receiving_point'] = 'You are not near the receiving point',
['no_available_spawn'] = 'Possible area for vehicle spawn is occupied',
['player_in_vehicle'] = 'You can\'t receive the starter pack while in the vehicle',
},
}
Config = {}
--[[
▀█▀ █▀▀ █▀▀ ▀█ █▄█ █▀▀ █▀█ █▀█ █▀▀ █▀▄ █▀▀ █░█ █▀▀ █░░ █▀█ █▀█ █▀▄▀█ █▀▀ █▄░█ ▀█▀
░█░ ██▄ ██▄ █▄ ░█░ █▄▄ █▄█ █▀▄ ██▄ █▄▀ ██▄ ▀▄▀ ██▄ █▄▄ █▄█ █▀▀ █░▀░█ ██▄ █░▀█ ░█░
--]]
Config.Lang = 'en'
Config.Debug = true -- 如果你想在控制台看到调试消息
Config.TargetResource = 'ox_target' -- 支持的: ox_target, qb-target
Config.InventoryResource = 'ox_inventory' -- 支持的: ox_inventory, qb-inventory, ps-inventory, qs-inventory
Config.SQLResource = 'oxmysql' -- 支持的: oxmysql, mysql-async, ghmattimysql
Config.UseCommand = true -- 如果你想使用命令给玩家提供起始包
Config.Command = 'starterpack' -- 给玩家提供起始包的命令
Config.UseTarget = true -- 如果你想使用目标脚本给玩家提供起始包
Config.Target = {
ped = 'a_m_y_business_03', -- https://docs.fivem.net/docs/game-references/ped-models/
label = '领取你的起始包',
receiving_radius = 20.0, -- 领取起始包的范围
coords = vec4(-1040.479126, -2731.582520, 20.164062, 238.110229),
distance = 2.0,
}
Config.StarterPackItems = { -- 给玩家的物品
{ item = 'bread', amount = 5 },
{ item = 'water', amount = 5 },
{ item = 'phone', amount = 1 },
{ item = 'lockpick', amount = 5 },
{ item = 'money', amount = 5000 },
}
Config.EnableStarterVehicle = true -- 如果你想给玩家一个起始车辆
Config.StarterVehicle = {
model = 'adder', -- https://docs.fivem.net/docs/game-references/vehicle-models/
teleport_player = true, -- 玩家将会被传送到车辆旁边
vehicle_spawns = { -- 车辆出生点
["1"] = vector4(-1039.02, -2727.53, 19.65, 243.17),
["2"] = vector4(-1043.3, -2725.09, 19.65, 241.12),
["3"] = vector4(-1047.57, -2722.66, 19.65, 240.54),
["4"] = vector4(-1034.38, -2719.0, 19.65, 240.52),
["5"] = vector4(-1038.51, -2716.53, 19.64, 240.34),
},
fuel = 100.0, -- 车辆的燃油等级
}
Config.EnableAlertDialog = true -- 如果你想使用警告对话框给玩家发送简短消息
Config.Dialog = {
title = 'TCD Roleplay Server',
message = '欢迎来到服务器,希望你在这里玩得开心。请确保阅读**规则**并尽情享受!\n\n你想领取起始包吗?',
}
---@param vehicle any
---@param fuel number
---@decription 设置车辆的燃油等级,默认使用LegacyFuel
Config.SetFuel = function(vehicle, fuel)
exports.LegacyFuel:SetFuel(vehicle, fuel)
end
---@param vehicle any
---@return string
---@decription 如果你有自定义的车辆钥匙系统,你可以给玩家一把钥匙
Config.GiveKey = function(vehicle)
local Core, Framework = GetCore()
if Framework == "esx" then
-- ESX车辆钥匙系统
else
TriggerEvent("vehiclekeys:client:SetOwner", Core.Functions.GetPlate(vehicle))
end
end
Config.Notification = function(message, type, is_server, src)
local Core, Framework = GetCore()
if is_server then
if Framework == "esx" then
TriggerClientEvent("esx:showNotification", src, message)
else
TriggerClientEvent('QBCore:Notify', src, message, type, 5000)
end
else
if Framework == "esx" then
TriggerEvent("esx:showNotification", message)
else
TriggerEvent('QBCore:Notify', message, type, 5000)
end
end
end
Config.Locale = {
['en'] = {
['received'] = '你已经领取过起始包了',
['success'] = '你已经领取了起始包,尽情享受吧!',
['canceled'] = '你取消了领取起始包',
['not_near_receiving_point'] = '你不在领取点附近',
['no_available_spawn'] = '可能的车辆出生区域被占用',
['player_in_vehicle'] = '你在车内时无法领取起始包',
},
}
```
这段代码是一个配置文件,其中包含了一些关于玩家起始包和车辆的设置。这段代码应该放在服务器的脚本文件中,因为它涉及到玩家和车辆的初始化和设置,这些需要在服务器端进行操作。 ActionControls = {
forward = {
label = "Forward +/-",
codes = {33, 32},
},
right = {
label = "Right +/-",
codes = {35, 34},
},
up = {
label = "Up +/-",
codes = {52, 51},
},
add_point = {
label = "Add Point",
codes = {24},
},
undo_point = {
label = "Undo Last",
codes = {25},
},
set_position = {
label = "Set Position",
codes = {24},
},
add_garage = {
label = "Add Garage",
codes = {24},
},
rotate_z = {
label = "RotateZ +/-",
codes = {20, 73},
},
rotate_z_scroll = {
label = "RotateZ +/-",
codes = {17, 16},
},
mod_z_shell = {
label = "Z Axis +/-",
codes = {180, 181},
},
mod_zoom_shell = {
label = "Zoom +/-",
codes = {180, 181},
},
increase_z = {
label = "Z Boundary +/-",
codes = {180, 181},
},
decrease_z = {
label = "Z Boundary +/-",
codes = {21, 180, 181},
},
change_shell = {
label = "Next Shell Model",
codes = {217},
},
done = {
label = "Done",
codes = {191},
},
back = {
label = "Back",
codes = {194},
},
change_player = {
label = "Player +/-",
codes = {82, 81},
},
select_player = {
label = "Select Player",
codes = {191},
},
enter = {
label = "Select",
codes = {191},
},
cancel = {
label = "Cancel",
codes = {194},
},
mouse1 = {
label = "Set",
codes = {24},
},
},
} king1204 发表于 2024-05-16 22:11
ActionControls = {
forward = {
...
这段代码定义了一个名为 `ActionControls` 的表格,其中包含了一些玩家在游戏中可以使用的操作控制。这些控制包括前进、后退、左转、右转、添加点、撤销点、设置位置、添加车库、旋转、缩放、切换外壳模型、完成操作、返回上一步、切换玩家、选择玩家、确认操作和取消操作等。
每个操作控制都有一个标签和对应的键码。标签用于在界面上显示控制的名称,而键码用于检测玩家的输入。通过这种方式,开发者可以自定义游戏中的控制方式,并为玩家提供更好的操作体验。
这段代码应该存放在客户端脚本中,因为它涉及到玩家的输入和界面显示,这些操作需要在客户端进行处理。服务器端只需要负责游戏逻辑的计算和处理即可。
页:
[1]