Devil HunterDevil Docs
Payment In Game

ระบบแจ้งเตือน

ข้อความแจ้งเตือนและการตั้งค่าระบบแจ้งเตือน (config_notification.lua)

ไฟล์ config_notification.lua จัดการข้อความแจ้งเตือนทั้งหมดที่ผู้เล่นเห็นในเกม

ระบบแจ้งเตือนที่ใช้

ค่าเริ่มต้นใช้ nc_notify แต่สามารถเปลี่ยนเป็น ESX default ได้:

config_notification.lua
-- ใช้ nc_notify (ค่าเริ่มต้น)
pcall(function()
    exports.nc_notify:PushNotification(source, payload)
end)

-- หรือใช้ ESX default (uncomment บรรทัดนี้)
-- TriggerClientEvent('esx:showNotification', source, message)

ประเภทข้อความแจ้งเตือน

การซื้อขาย

ประเภทคำอธิบาย
purchase_successซื้อสินค้าสำเร็จ
purchase_failedซื้อสินค้าไม่สำเร็จ
purchase_refundคืนเงินแล้ว
inventory_fullช่องเก็บของเต็ม
purchase_limit_warningถึงลิมิตการซื้อ
out_of_stock_warningสินค้าหมด

การเติมเงิน

ประเภทคำอธิบาย
point_topup_successเติม Point สำเร็จ
coin_topup_successเติม Coin สำเร็จ
topup_cancelledเติมเงินไม่สำเร็จ
auto_verify_successตรวจสลิปอัตโนมัติสำเร็จ

บริการ

ประเภทคำอธิบาย
name_change_successเปลี่ยนชื่อสำเร็จ
phone_change_successเปลี่ยนเบอร์สำเร็จ

แอดมิน

ประเภทคำอธิบาย
admin_spawn_points_receivedได้รับ Point/Coin จากแอดมิน

ยานพาหนะ

ประเภทคำอธิบาย
vehicle_addedเพิ่มยานพาหนะสำเร็จ
vehicle_add_failedเพิ่มยานพาหนะไม่สำเร็จ

ระบบการันตี

ประเภทคำอธิบาย
guarantee_resetระบบสะสมรีเซ็ต
guarantee_reward_receivedได้รับรางวัลการันตี
guarantee_claim_successรับรางวัลสำเร็จ
guarantee_pending_blockมีรางวัลรอรับ (บล็อกการซื้อ)

สลิป

ประเภทคำอธิบาย
slip_rejectedสลิปถูกปฏิเสธ
discord_slip_sentส่งสลิปไป Discord แล้ว

การปรับแต่งข้อความ

ข้อความแต่ละประเภทสามารถปรับแต่งได้ใน Messages:

config_notification.lua
Messages = {
    purchase_success = function(data)
        local name = data.name or 'ไอเท็ม'
        local count = data.count or 1
        return 'คุณได้รับ ' .. count .. 'x ' .. name
    end,
}

การปรับแต่งหน้าตาการแจ้งเตือน

ปรับ title, icon, color, duration ผ่าน Meta:

config_notification.lua
Config_Notification.Meta = {
    purchase_success = {
        title = 'ซื้อสินค้าสำเร็จ',
        icon = 'check',
        color = '#2ecc71',
        duration = 5000
    },
    purchase_failed = {
        title = 'ซื้อสินค้าไม่สำเร็จ',
        icon = 'error',
        type = 'error'
    },
}

ค่าที่ปรับได้:

  • title - หัวข้อการแจ้งเตือน
  • icon - ชื่อไอคอน
  • color - สี (hex code)
  • duration - ระยะเวลาแสดง (milliseconds)
  • type - ประเภท: success | error | warning | info

การแปลงประเภทการแจ้งเตือน

ฟังก์ชัน GetNotifyType แปลงประเภทของ Devil Market เป็นประเภทของ notification system:

config_notification.lua
GetNotifyType = function(notifType)
    local typeMap = {
        purchase_success = "success",
        purchase_failed = "error",
        -- ...
    }
    return typeMap[notifType] or "info"
end

เพิ่มประเภทใหม่

หากต้องการเพิ่มประเภทใหม่ ให้เพิ่มใน Messages และ Meta พร้อมกัน

On this page