Cloth System
การตั้งค่าฝั่งไคลเอนต์
config_client.lua - การตั้งค่าฝั่งไคลเอนต์ (แจ้งเตือน, UI)
ไฟล์ config_client.lua เก็บการตั้งค่าฝั่งไคลเอนต์ เช่น ระบบแจ้งเตือนเฉพาะเหตุการณ์
ระบบแจ้งเตือน
Config_cl["notification_setting"] = function(type, text)
-- ใช้ pNotify เป็นค่าเริ่มต้น
TriggerEvent("pNotify:SendNotification", {
text = text,
type = type, -- success, error, warning, info
queue = "lmao",
timeout = 5000,
layout = "bottomCenter"
})
endการเปลี่ยนระบบแจ้งเตือน
ถ้าใช้ระบบอื่น (เช่น ox_lib, mythic_notify) ให้แก้ฟังก์ชันด้านบนให้ตรงกับระบบที่ใช้
ตัวอย่าง: ใช้ ox_lib
Config_cl["notification_setting"] = function(type, text)
lib.notify({
title = 'Devil Cloth System',
description = text,
type = type
})
endตัวอย่าง: ใช้ ESX default
Config_cl["notification_setting"] = function(type, text)
ESX.ShowNotification(text)
end