- 黄金
- 367.90 黄金
Project Sloth MDT
依赖
- QBCore
- ps-dispatch
- oxmysql
- qb-apartments | Config 可用于启用或禁用的配置。
- qb-communityservice - 如果您打算送去社区服务。
安装
- 下载压缩包
- 将资源拖放到服务器文件中,确保删除文件夹名称中的 -main
- 运行附加的 SQL 脚本 (mdt.sql)
武器信息导出
添加用于插入武器信息记录的服务器导出,这些记录可以在服务器的其他地方使用,例如武器购买,以将信息添加到 mdt。以下是其语法,所有参数都是字符串。
Lua:
exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel)

ox_inventory 的设置
- 在modules > shops > server.lua 上找到 ox_inventory:buyItem
- 添加以下代码块
-
Lua:
\\Existing code below for reference, put it right under it. \\ local message = locale('purchased_for', count, fromItem.label, (currency == 'money' and locale('$') or math.groupdigits(price)), (currency == 'money' and math.groupdigits(price) or ' '..Items(currency).label)) \\Existing code above for reference, put it right under it. \\ if string.find(fromData.name, "WEAPON_") then local serial = metadata.serial local imageurl = ("https://cfx-nui-ox_inventory/web/images/%s.png"):format(fromData.name) local notes = "Purchased from shop" local owner = playerInv.owner local weapClass = "Class" local weapModel = fromData.name AddWeaponToMDT(serial, imageurl, notes, owner, weapClass, weapModel) end
- 在脚本末尾添加 以下函数。
-
Lua:
\\Existing code below for reference, put it right under it. \\ server.shops = Shops \\Existing code above for reference, put it right under it. \\ function AddWeaponToMDT(serial, imageurl, notes, owner, weapClass, weapModel) Citizen.CreateThread(function() Wait(500) local success, result = pcall(function() return exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel) end) if not success then print("Unable to add weapon to MDT") end end) end
自助注册武器
- 您的公民可以自行注册库存中发现的武器。如果您使用 qb-target,则要触发的事件如下。还有一个名为 registerweapon 的命令可用,但如果您想使用它,则需要取消注释。
Lua:
ps-mdt:client:selfregister
自动照片照片

自动照片拍摄设置
- 将 Config.UseCQCMugshot 设置为 true,默认为 true。 (Config.lua 中的第 5 行)
-
Lua:
Config.UseCQCMugshot = true
-
- 通过更改以下内容来选择您想要的照片:(Config.lua 中的第 8 行)
-
Lua:
-- Front, Back Side. Use 4 for both sides, we recommend leaving at 1 for default. Config.MugPhotos = 1
-
- 创建一个 Discord Webhook 并将其添加到此处
-
Lua:
-- Images for mug shots will be uploaded here. Add a Discord webhook. local MugShotWebhook = ''
-
通过物品罚款和引用
- 将项目添加到您的shared.lua > items.lua
-
Lua:
['mdtcitation'] = {['name'] = 'mdtcitation', ['label'] = 'Citation', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'citation.png', ['unique'] = true, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Citation from a police officer!'},
-
- 将以下代码添加到您的 inventory > app.js。应该在markbills 附近,请参阅下文以供参考。
-
Lua:
} else if (itemData.name == "mdtcitation") { $(".item-info-title").html("<p>" + itemData.label + "</p>"); $(".item-info-description").html( '<p><strong>Citizen ID: </strong><span>' + itemData.info.citizenId + '</span></p>' + '<p><strong>Fine: </strong><span>' + itemData.info.fine + '</span></p>' + '<p><strong>Citation Date: </strong><span>' + itemData.info.date + '</span></p>' + '<p><strong>Incident ID: </strong><span>' + itemData.info.incidentId + '</span></p>' + '<p><strong>Involved Officer: </strong><span>' + itemData.info.officer + '</span></p>' );
-
- 正确放置的参考。
上班/下班打卡和排行榜
- 当警官从 MDT 内部切换职责时触发。
- 创建一个 Discord Webhook 并将其添加到此处
Lua:local ClockinWebhook = ''

监禁和社区服务
- 如果您在入狱时因企图滥用职权而被踢。在 qb-policejob > server > main.lua 上找到下面的以下事件
Lua:
police:server:JailPlayer
- 然后注释掉第 779 行,如下所示
Lua:
-- if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, "Attempted exploit abuse") end
背包编辑|自动添加带有图像的武器
- lj-inventory 已经包含了其工作所需的更改。
- qb-inventory 请遵循以下说明。
- 编辑以下事件
-
Lua:
RegisterNetEvent('inventory:server:SetInventoryData', function(fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount)
-
Lua:
elseif QBCore.Shared.SplitStr(shopType, "_")[1] == "Itemshop" then if Player.Functions.RemoveMoney("cash", price, "itemshop-bought-item") then if QBCore.Shared.SplitStr(itemData.name, "_")[1] == "weapon" then itemData.info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4)) itemData.info.quality = 100 end local serial = itemData.info.serie local imageurl = ("https://cfx-nui-qb-inventory/html/images/%s.png"):format(itemData.name) local notes = "Purchased at Ammunation" local owner = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname local weapClass = 1 local weapModel = QBCore.Shared.Items[itemData.name].label AddItem(src, itemData.name, fromAmount, toSlot, itemData.info) TriggerClientEvent('qb-shops:client:UpdateShop', src, QBCore.Shared.SplitStr(shopType, "_")[2], itemData, fromAmount) QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success") exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel) TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price) elseif bankBalance >= price then Player.Functions.RemoveMoney("bank", price, "itemshop-bought-item") if QBCore.Shared.SplitStr(itemData.name, "_")[1] == "weapon" then itemData.info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4)) itemData.info.quality = 100 end local serial = itemData.info.serie local imageurl = ("https://cfx-nui-qb-inventory/html/images/%s.png"):format(itemData.name) local notes = "Purchased at Ammunation" local owner = Player.PlayerData.charinfo.firstname .. " " .. Player.PlayerData.charinfo.lastname local weapClass = 1 local weapModel = QBCore.Shared.Items[itemData.name].label AddItem(src, itemData.name, fromAmount, toSlot, itemData.info) TriggerClientEvent('qb-shops:client:UpdateShop', src, QBCore.Shared.SplitStr(shopType, "_")[2], itemData, fromAmount) QBCore.Functions.Notify(src, itemInfo["label"] .. " bought!", "success") exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel) TriggerEvent("qb-log:server:CreateLog", "shops", "Shop item bought", "green", "**"..GetPlayerName(src) .. "** bought a " .. itemInfo["label"] .. " for $"..price) else QBCore.Functions.Notify(src, "You don't have enough cash..", "error") end
-
- 编辑以下事件
支持 Wolfknight 雷达和读板器
如果发生以下情况,车牌读取器会自动锁定并向警方发出警报:
- 诚征车主
- 车主没有驾驶执照
- 车辆有 BOLO
- 确保在 wk_wars2x/config.lua 中设置“CONFIG.use_sonorancad = true”
视频演示(梯子)




交通停止径向菜单警报
- 当启动交通拦截时,您可以将您的位置通知您的同事,并通过径向菜单提供有关当前位置和停止车辆的详细信息。
- 在 cl_plate_reader.lua 上的 READER:Main() 函数上方添加以下代码
-
Lua:
local Vehicle = nil local function GetFrontPlate() local data = { locked = READER.vars.cams["front"].locked, plate = READER.vars.cams["front"].plate, veh = Vehicle, } return data end exports("GetFrontPlate", GetFrontPlate)
-
- 在函数 READER:Main() 上的 local veh = UTIL:GetVehicleInDirection( PLY.veh, start, offset ) 之后将以下内容添加到 cl_plate_reader.lua 中
-
Lua:
if i == 1 then Vehicle = veh end
-
- 在 cl_plate_reader.lua 上的 READER:Main() 函数上方添加以下代码
- 完成上述步骤后应该看起来像这样。
- 将 ps-mdt:client:trafficStop 添加到径向菜单中
预览

名册和 SOP 设置
您需要一个可查看的 Google 文档/表格链接。将您在配置中获得的链接粘贴到此处:
Lua:
-- Google Docs Link
Config.sopLink = {
['police'] = '',
['ambulance'] = '',
['bcso'] = '',
['doj'] = '',
['sast'] = '',
['sasp'] = '',
['doc'] = '',
['lssd'] = '',
['sapr'] = '',
}
-- Google Docs Link
Config.RosterLink = {
['police'] = '',
['ambulance'] = '',
['bcso'] = '',
['doj'] = '',
['sast'] = '',
['sasp'] = '',
['doc'] = '',
['lssd'] = '',
['sapr'] = '',
}
预览








多部门
LSPD
BCSO

SASP

SAST

SAPR

LSSD

DOC

FAQ
- 如何对事件中的罪犯提出指控? - 找到犯罪公民并将其添加到事件中后,右键单击犯罪分子姓名下方的空间,然后选择“添加指控”。

- 我的调度呼叫没有被填充? - 您尚未在 mdt 之前启动调度资源或重命名调度资源名称,并且未在 mdt 中进行必要的更改来反映这一点。
- 收到有关 utf8mb4_unicode 非法排序规则的错误? - QBCore 决定更改新 txAdmin 配方上的排序规则,将玩家表上的排序规则更改为 utf8mb4_general_ci。在您的数据库上运行下面的查询以自动更改它。
SQL:
ALTER TABLE players CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
外观重设
以下存储库是 ps-mdt 的直接分支,并经过编辑以适合某些国家/地区/外观。制作人员
- 最初 Echo RP MDT 发布者 Flawws#999
- CQC-Scripting for their cqc-mugshot
- JoeSzymkowicz
- MonkeyWhisper
- Snipe
- BackSH00TER
- nggcasey
- OK1ez
- Crayons0814
- LeSiiN
- ImXirvin
- lenzh
- 我们可能错过的其他所有人,谢谢!
下载
最后编辑: