Payment In Game
ระบบแจ้งเตือน
ข้อความแจ้งเตือนและการตั้งค่าระบบแจ้งเตือน (config_notification.lua)
ไฟล์ config_notification.lua จัดการข้อความแจ้งเตือนทั้งหมดที่ผู้เล่นเห็นในเกม
ระบบแจ้งเตือนที่ใช้
ค่าเริ่มต้นใช้ nc_notify แต่สามารถเปลี่ยนเป็น ESX default ได้:
-- ใช้ 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:
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.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:
GetNotifyType = function(notifType)
local typeMap = {
purchase_success = "success",
purchase_failed = "error",
-- ...
}
return typeMap[notifType] or "info"
endเพิ่มประเภทใหม่
หากต้องการเพิ่มประเภทใหม่ ให้เพิ่มใน Messages และ Meta พร้อมกัน