Merge branch 'main' into main

This commit is contained in:
Kakarot
2025-06-22 14:38:43 -05:00
committed by GitHub
4 changed files with 212 additions and 6 deletions
@@ -0,0 +1,75 @@
name: Semantic Version Bump (Conventional Commits)
on:
push:
branches:
- main
jobs:
semver-bump:
runs-on: ubuntu-latest
if: github.event.head_commit.author.name != 'github-actions[bot]'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Determine bump type from commit message
id: bump
run: |
COMMIT_MSG="${{ github.event.head_commit.message }}"
echo "🔍 Commit message: $COMMIT_MSG"
if echo "$COMMIT_MSG" | grep -qE 'BREAKING CHANGE|!:'; then
echo "bump=major" >> $GITHUB_OUTPUT
elif echo "$COMMIT_MSG" | grep -qE '^feat(\(.+\))?:'; then
echo "bump=minor" >> $GITHUB_OUTPUT
elif echo "$COMMIT_MSG" | grep -qE '^fix(\(.+\))?:'; then
echo "bump=patch" >> $GITHUB_OUTPUT
else
echo "bump=none" >> $GITHUB_OUTPUT
fi
- name: Bump version in fxmanifest.lua
if: steps.bump.outputs.bump != 'none'
run: |
FILE="fxmanifest.lua"
VERSION_LINE=$(grep -E "version ['\"]?[0-9]+\.[0-9]+\.[0-9]+['\"]?" "$FILE")
VERSION=$(echo "$VERSION_LINE" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+")
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
case "${{ steps.bump.outputs.bump }}" in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
patch)
PATCH=$((PATCH + 1))
;;
esac
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
sed -i "s/version ['\"]$VERSION['\"]/version '$NEW_VERSION'/" "$FILE"
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Commit and push version bump
if: steps.bump.outputs.bump != 'none'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add fxmanifest.lua
if git diff --cached --quiet; then
echo "⚠️ No version changes to commit."
exit 0
fi
COMMIT_MSG="${{ github.event.head_commit.message }}"
git commit -m "ci: bump fxmanifest version to ${{ env.new_version }} $COMMIT_MSG"
git push
+2 -2
View File
@@ -120,10 +120,10 @@ local Translations = {
},
}
if GetConvar('qb_locale', 'en') == 'cn' then
if GetConvar('qb_locale', 'en') == 'zh-cn' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
end
+133
View File
@@ -0,0 +1,133 @@
local Translations = {
error = {
not_online = '玩家不在線上',
wrong_format = '格式不正確',
missing_args = '尚未輸入所有參數 (x, y, z)',
missing_args2 = '必須填寫所有參數!',
no_access = '無法使用此指令',
company_too_poor = '您的雇主已破產',
item_not_exist = '物品不存在',
too_heavy = '背包已滿',
location_not_exist = '位置不存在',
duplicate_license = '[QBCORE] - 發現重複的 Rockstar 授權',
no_valid_license = '[QBCORE] - 找不到有效的 Rockstar 授權',
not_whitelisted = '[QBCORE] - 您不在此伺服器的白名單中',
server_already_open = '伺服器已經開啟',
server_already_closed = '伺服器已經關閉',
no_permission = '您沒有此權限..',
no_waypoint = '尚未設置導航點',
tp_error = '傳送時發生錯誤',
ban_table_not_found = '[QBCORE] - 無法在資料庫中找到封禁清單。請確認您已正確匯入 SQL 檔案。',
connecting_database_error = '[QBCORE] - 連接資料庫時發生錯誤。請確保 SQL 伺服器正在運行,且 server.cfg 檔案中的設定正確。',
connecting_database_timeout = '[QBCORE] - 資料庫連接超時。請確保 SQL 伺服器正在運行,且 server.cfg 檔案中的設定正確。',
},
success = {
server_opened = '伺服器已經開啟',
server_closed = '伺服器已經關閉',
teleported_waypoint = '傳送至導航點。',
},
info = {
received_paycheck = '您收到了 $%{value} 的薪水',
job_info = '工作: %{value} | 等級: %{value2} | 上班狀態: %{value3}',
gang_info = '幫派: %{value} | 等級: %{value2}',
on_duty = '您現在已經上班了!',
off_duty = '您現在已經下班了!',
checking_ban = '你好 %s,我們正在檢查您是否被封禁',
join_server = '歡迎 %s 加入 {Server Name}',
checking_whitelisted = '你好 %s,我們正在檢查您的白名單權限',
exploit_banned = '您因作弊行為而被封禁。請查看我們的 Discord 以獲取更多資訊: %{discord}',
exploit_dropped = '您因使用外掛程式而被踢出伺服器',
},
command = {
tp = {
help = '傳送至玩家或座標 (僅限管理員)',
params = {
x = { name = 'id/x', help = '玩家 ID 或 X 座標' },
y = { name = 'y', help = 'Y 座標' },
z = { name = 'z', help = 'Z 座標' },
},
},
tpm = { help = '傳送至標記點 (僅限管理員)' },
togglepvp = { help = '切換伺服器 PVP 狀態 (僅限管理員)' },
addpermission = {
help = '給予玩家權限 (僅限最高權限)',
params = {
id = { name = 'id', help = '玩家 ID' },
permission = { name = 'permission', help = '權限等級' },
},
},
removepermission = {
help = '移除玩家權限 (僅限最高權限)',
params = {
id = { name = 'id', help = '玩家 ID' },
permission = { name = 'permission', help = '權限等級' },
},
},
openserver = { help = '開放伺服器給所有人 (僅限管理員)' },
closeserver = {
help = '關閉伺服器給無權限者 (僅限管理員)',
params = {
reason = { name = 'reason', help = '關閉原因 (選填)' },
},
},
car = {
help = '生成載具 (僅限管理員)',
params = {
model = { name = 'model', help = '載具型號名稱' },
},
},
dv = { help = '刪除載具 (僅限管理員)' },
dvall = { help = '刪除所有載具 (僅限管理員)' },
dvp = { help = '刪除所有 NPC (僅限管理員)' },
dvo = { help = '刪除所有物件 (僅限管理員)' },
givemoney = {
help = '給予玩家金錢 (僅限管理員)',
params = {
id = { name = 'id', help = '玩家 ID' },
moneytype = { name = 'moneytype', help = '金錢類型 (現金, 銀行, 加密貨幣)' },
amount = { name = 'amount', help = '金額' },
},
},
setmoney = {
help = '設定玩家金錢數量 (僅限管理員)',
params = {
id = { name = 'id', help = '玩家 ID' },
moneytype = { name = 'moneytype', help = '金錢類型 (現金, 銀行, 加密貨幣)' },
amount = { name = 'amount', help = '金額' },
},
},
job = { help = '查看你的工作' },
setjob = {
help = '設定玩家工作 (僅限管理員)',
params = {
id = { name = 'id', help = '玩家 ID' },
job = { name = 'job', help = '工作名稱' },
grade = { name = 'grade', help = '工作等級' },
},
},
gang = { help = '查看你所在的幫派' },
setgang = {
help = '設定玩家幫派 (僅限管理員)',
params = {
id = { name = 'id', help = '玩家 ID' },
gang = { name = 'gang', help = '幫派名稱' },
grade = { name = 'grade', help = '幫派等級' },
},
},
ooc = { help = 'OOC 聊天訊息' },
me = {
help = '顯示本地訊息',
params = {
message = { name = 'message', help = '要發送的訊息' }
},
},
},
}
if GetConvar('qb_locale', 'en') == 'zh-tw' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+2 -4
View File
@@ -7,7 +7,6 @@ QBCore.UsableItems = {}
-- Get your player first and then trigger a function on them
-- ex: local player = QBCore.Functions.GetPlayer(source)
-- ex: local example = player.Functions.functionname(parameter)
---Gets the coordinates of an entity
---@param entity number
---@return vector4
@@ -441,9 +440,9 @@ function QBCore.Functions.CreateVehicle(source, model, vehtype, coords, warp)
end
function PaycheckInterval()
if not next(QBCore.Players) then
if not next(QBCore.Players) then
SetTimeout(QBCore.Config.Money.PayCheckTimeOut * (60 * 1000), PaycheckInterval) -- Prevent paychecks from stopping forever once 0 players
return
return
end
for _, Player in pairs(QBCore.Players) do
if not Player then return end
@@ -780,6 +779,5 @@ for functionName, func in pairs(QBCore.Functions) do
exports(functionName, func)
end
end
-- Access a specific function directly:
-- exports['qb-core']:Notify(source, 'Hello Player!')