PED System
client
local IsChangePED = false
如果不是 IsChangePED 就把下方 return 後的 IsChangePED 改成你上方顯示的
exports('getPedUsed', function()
return IsChangePED
end)
滑到使用物品的事件
RegisterNetEvent('phacs_pedmenu:UseItem')
AddEventHandler('phacs_pedmenu:UseItem', function(modelHash)
if IsChangePED then
else
if GetResourceState('sun_territorywar') == "started" then
local WarStatus = exports['sun_territorywar']:getWarStatus()
local WarIsZone = exports['sun_territorywar']:getIsZone()
if WarStatus and WarIsZone then
exports.pNotify:SendNotification({
text = "<b style='color:red'>該區域禁止使用PED</b>",
type = "error",
queue = "error",
timeout = 3000,
layout = "bottomCenter",
})
return
end
end
IsChangePED = true
LoadModel(modelHash)
end
end)
config檔 PEDSettings
exports['改為你PED系統的']:getPedUsed()
TriggerEvent('phacs_pedmenu:UseItem') phacs_pedmenu:UseItem
改成 你使用的註冊方式
function PEDSettings()-- 關閉PED系統 - 客戶端
local PEDStatus = exports['phacs_pedmenu']:getPedUsed()
if PEDStatus then
TriggerEvent('phacs_pedmenu:UseItem')
end
return PEDStatus
end
Last updated