GD Docs

ตั้งค่า Notification

อัปเดตล่าสุด
lua
// config/config.notification.lua

-- จะทำงานสำหรับการแจ้งเตือนฝั่ง Client
Config.ClientNotification = function(type, title, content, duration)
     -- type = ประเภทของการแจ้งเตือน เช่น "success", "error", "info" เป็นต้น
     -- title = ชื่อหัวข้อ
     -- content = รายละเอียดการแจ้งเตือน
     -- duration = ระยะเวลาการแสดงแจ้งเตือน (ms)
     
     -- ปรับแต่งให้เข้ากับ Notify ที่ทางเซิฟเวอร์ใช้งาน (ตัวอย่าง)
     exports.gd_notify:AddNotify({
          alertType = 'alert',
          type = type,
          title = title,
          content = content,
          duration = duration
     })
end

-- จะทำงานสำหรับการแจ้งเตือนฝั่ง Server
Config.ServerNotification = function(playerId, type, title, content, duration)
     -- type = ประเภทของการแจ้งเตือน เช่น "success", "error", "info" เป็นต้น
     -- title = ชื่อหัวข้อ
     -- content = รายละเอียดการแจ้งเตือน
     -- duration = ระยะเวลาการแสดงแจ้งเตือน (ms)
     
     -- ปรับแต่งให้เข้ากับ Notify ที่ทางเซิฟเวอร์ใช้งาน (ตัวอย่าง)
     TriggerClientEvent("gd_notify:AddNotify", playerId, {
          alertType = 'alert',
          type = type,
          title = title,
          content = content,
          duration = duration
     })
end