example
example

资源 ps-mdt

Yann

站长
管理成员
GTAOS管理组
认证卖家
认证用户
本 月 名 人 榜 最 佳

Project Sloth MDT​

依赖​

安装​

  • 下载压缩包
  • 将资源拖放到服务器文件中,确保删除文件夹名称中的 -main
  • 运行附加的 SQL 脚本 (mdt.sql)

武器信息导出​

添加用于插入武器信息记录的服务器导出,这些记录可以在服务器的其他地方使用,例如武器购买,以将信息添加到 mdt。以下是其语法,所有参数都是字符串。
lua:
exports['ps-mdt']:CreateWeaponInfo(serial, imageurl, notes, owner, weapClass, weapModel)
1704266681968.png

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
视频预览

自动照片照片​

1704266884471.png

自动照片拍摄设置​

  • 将 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>'
          );
  • 正确放置的参考。
    • 1704267142183.png

上班/下班打卡和排行榜​

  • 当警官从 MDT 内部切换职责时触发。
  • 创建一个 Discord Webhook 并将其添加到此处
    lua:
    local ClockinWebhook = ''
1704267236585.png

监禁和社区服务​

  • 如果您在入狱时因企图滥用职权而被踢。在 qb-policejob > server > main.lua 上找到下面的以下事件
lua:
police:server:JailPlayer
  • 然后注释掉第 779 行,如下所示
lua:
-- if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, "Attempted exploit abuse") end

背包编辑|自动添加带有图像的武器​

  1. lj-inventory 已经包含了其工作所需的更改。
  2. qb-inventory 请遵循以下说明。
    1. 编辑以下事件
      1. lua:
        RegisterNetEvent('inventory:server:SetInventoryData', function(fromInventory, toInventory, fromSlot, toSlot, fromAmount, toAmount)
      2. 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 车牌读取器和雷达兼容性
支持 Wolfknight 雷达和读板器
如果发生以下情况,车牌读取器会自动锁定并向警方发出警报:
  • 诚征车主
  • 车主没有驾驶执照
  • 车辆有 BOLO
重要的:
  • 确保在 wk_wars2x/config.lua 中设置“CONFIG.use_sonorancad = true”
这减少了针对玩家车辆的车牌读取器事件,并且不会在数据库中查询数百辆 NPC 车辆

视频演示(梯子)​

1704267626722.png
1704267636706.png
1704267657142.png
1704267671100.png

交通停止径向菜单警报​

  1. 当启动交通拦截时,您可以将您的位置通知您的同事,并通过径向菜单提供有关当前位置和停止车辆的详细信息。
    1. 在 cl_plate_reader.lua 上的 READER:Main() 函数上方添加以下代码
      1. 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)
    2. 在函数 READER:Main() 上的 local veh = UTIL:GetVehicleInDirection( PLY.veh, start, offset ) 之后将以下内容添加到 cl_plate_reader.lua 中
      1. lua:
                    if i == 1 then
                        Vehicle = veh
                    end
  2. 完成上述步骤后应该看起来像这样。
    1. 1704267937452.png
  3. 将 ps-mdt:client:trafficStop 添加到径向菜单中

预览​

1704268102573.png

名册和 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'] = '',   
}

预览​

1704268173333.png
1704268193604.png
1704268211246.png
1704268233008.png

1704268250144.png
1704268265352.png
1704268282994.png
1704268300563.png

多部门​

LSPD
1704268329048.png
BCSO
1704268346637.png
SASP
1704268359378.png
SAST
1704268371893.png
SAPR
1704268382933.png
LSSD
1704268395963.png
DOC
1704268406943.png

FAQ​

  • 如何对事件中的罪犯提出指控? - 找到犯罪公民并将其添加到事件中后,右键单击犯罪分子姓名下方的空间,然后选择“添加指控”。
1704268498576.png
  • 我的调度呼叫没有被填充? - 您尚未在 mdt 之前启动调度资源或重命名调度资源名称,并且未在 mdt 中进行必要的更改来反映这一点。
  • 收到有关 utf8mb4_unicode 非法排序规则的错误? - QBCore 决定更改新 txAdmin 配方上的排序规则,将玩家表上的排序规则更改为 utf8mb4_general_ci。在您的数据库上运行下面的查询以自动更改它。
SQL:
ALTER TABLE players CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci

外观重设​

以下存储库是 ps-mdt 的直接分支,并经过编辑以适合某些国家/地区/外观。

制作人员​

下载​

 
最后编辑:
顶部