QBCore寻宝插件

QBCore寻宝插件

QBCore 的寻宝脚本

允许玩家使用数码扫描仪来定位宝藏的脚本。

主要特点

  • 使用数码扫描仪比例表显示有关宝藏位置的信息
  • 当玩家面对宝藏的位置时,数码扫描仪上的条形图会变成蓝色
  • 当玩家在金库的位置时,条形图会变为绿色
  • 在该位置使用铲子挖掘宝藏
  • 宝藏位置作为元数据保存在项目上
  • 管理员命令为正确设置元数据的 digiscanner 提供/givescanner [id]

安装

  • 拖放到资源文件中,并确保glow_treasure在 server.cfg 中
  • 要让玩家在物品从库存中移除时解除装备数码扫描仪,请转到 ,找到事件并添加以下内容qb-inventory/client/main.luainventory:client:CheckWeapon
RegisterNetEvent('inventory:client:CheckWeapon', function(weaponName)
    -- Start of Added Code
    if weaponName == "digiscanner" or weaponName == "metaldetector" then
        TriggerEvent("glow_treasure_cl:scannerRemoved")
        return
    end
    -- End of Added Code
    if currentWeapon ~= weaponName:lower() then return end
    local ped = PlayerPedId()
    TriggerEvent('weapons:ResetHolster')
    SetCurrentPedWeapon(ped, `WEAPON_UNARMED`, true)
    RemoveAllPedWeapons(ped, true)
    currentWeapon = nil
end)
  • 如果玩家使用武器,导致数码扫描仪脱装备,则需要触发一个事件来停止维持鳞片形状的循环。
    • 转到qb-weapons/client/main.lua
    • 查找活动weapons:client:SetCurrentWeapon
    • TriggerEvent("glow_treasure_cl:weaponUpdated")
RegisterNetEvent('weapons:client:SetCurrentWeapon', function(data, bool)
    if data ~= false then
        CurrentWeaponData = data
    else
        CurrentWeaponData = {}
    end
    CanShoot = bool
    -- Added event
    TriggerEvent("glow_treasure_cl:weaponUpdated")
end)
  • 将项目添加到qb-core/shared/items.lua
["digiscanner"] 			     = {["name"] = "digiscanner", 					["label"] = "Digiscanner", 				["weight"] = 2000, 		["type"] = "item", 		["image"] = "digiscanner.png", 			["unique"] = true, 		["useable"] = true, 	["shouldClose"] = true,    ["combinable"] = nil,   ["description"] = "Used to scan for things.."},
	["shovel"] 			     		 = {["name"] = "shovel", 						["label"] = "Shovel", 					["weight"] = 3000, 		["type"] = "item", 		["image"] = "shovel.png", 				["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,    ["combinable"] = nil,   ["description"] = "A handy shovel."},
  • 如果您的服务器上运行的线程禁用了瞄准辅助,它可能会干扰扫描仪。请参阅此处了解如何修复它#2(评论)

 

 
© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容