🏬
SUN SCRIPT 插件文檔網站
  • 📚太陽插件開發商 | 文檔中心
  • 官方網站
    • 如何使用tebex禮品卡
  • 插件列表
    • 📦右上角資訊v1 | sun_serinfo
      • ⚙️使用說明
      • 🧭插件配置
    • 📦右上角資訊v2 | sun_serinfoV2
      • ⚙️使用說明
  • 📦掛機系統 | sun_AFKReward
    • VIP 設定
  • 📦車輛白名單 | sun_Whitelistcar
    • 抓不到車輛問題解決方法
  • 📦線上玩家獎勵系統 | sun_OnlinePlayer
    • 如何重新刷新紀錄
  • 📦地盤爭奪 | sun_territorywar
    • 如何安裝 how install ?
    • 設定 Settings
    • 問題 issue
      • PED System
  • 檔案販售教學
    • 如何設定discord紀錄
      • 有內建紀錄的插件
    • 如何更改按鍵
Powered by GitBook
On this page
  1. 地盤爭奪 | sun_territorywar
  2. 問題 issue

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
Previous問題 issueNext如何設定discord紀錄

Last updated 4 months ago

📦