允许玩家使用数码扫描仪来定位宝藏的脚本。
- 使用数码扫描仪比例表显示有关宝藏位置的信息
- 当玩家面对宝藏的位置时,数码扫描仪上的条形图会变成蓝色
- 当玩家在金库的位置时,条形图会变为绿色
- 在该位置使用铲子挖掘宝藏
- 宝藏位置作为元数据保存在项目上
- 管理员命令为正确设置元数据的 digiscanner 提供
/givescanner [id]
- 拖放到资源文件中,并确保glow_treasure在 server.cfg 中
- 要让玩家在物品从库存中移除时解除装备数码扫描仪,请转到 ,找到事件并添加以下内容
qb-inventory/client/main.lua
inventory: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
- 最新
- 最热
只看作者