การติดตั้งทรัพยากร
เริ่มต้นการใช้งาน
- ดาวน์โหลดและแตกไฟล์ลงในโฟลเดอร์
resources
ของคุณ ชื่อของทรัพยากรจะต้องเป็นazael_ui-itemnotify
ห้ามแก้ไขชื่อของทรัพยากรโดยเด็ดขาด เนื่องจากทรัพยากรจะไม่ทำงาน - เปิดไฟล์
server.cfg
เพิ่มensure azael_ui-itemnotify
ไว้ด้านล่าง es_extended
ปิดแจ้งเตือน ESX.UI
ไปที่ es_extended/client/main.lua
ค้นหา
ESX.UI.ShowInventoryItemNotification
แก้ไขเป็น
--ESX.UI.ShowInventoryItemNotification
ESX.UI.ShowInventoryItemNotification
ทั้งหมดภายในไฟล์ es_extended/client/main.lua
การติดตั้งใน es_extended v1.1.x
es_extended เวอร์ชั่น v1.1.x
จะใช้ระบบ limit
หากเซิร์ฟเวอร์ของคุณใช้เวอร์ชั่นนี้อยู่ ให้คุณไปที่ es_extended/server/classes/player.lua
และดำเนินการติดตั้งรหัสทริกเกอร์ เพื่อส่งกิจกรรมมายังทรัพยากร azael_ui-itemnotify
ตามขั้นตอนด้านล่างนี้
es_extended/__resource.lua
self.setMoney
ค้นหา
self.setMoney = function
มองหา
self.player.setMoney(money)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendMoney', 'set', money, self.source)
self.addMoney
ค้นหา
self.addMoney = function
มองหา
self.player.addMoney(money)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendMoney', 'add', money, self.source)
self.removeMoney
ค้นหา
self.removeMoney = function
มองหา
self.player.removeMoney(money)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendMoney', 'remove', money, self.source)
self.setAccountMoney
ค้นหา
self.setAccountMoney = function
มองหา
TriggerClientEvent('esx:setAccountMoney', self.source, account)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendAccountMoney', 'set', acc, money, self.source)
self.addAccountMoney
ค้นหา
self.addAccountMoney = function
มองหา
TriggerClientEvent('esx:setAccountMoney', self.source, account)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendAccountMoney', 'add', acc, money, self.source)
self.removeAccountMoney
ค้นหา
self.removeAccountMoney = function
มองหา
TriggerClientEvent('esx:setAccountMoney', self.source, account)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendAccountMoney', 'remove', a, m, self.source)
self.addInventoryItem
ค้นหา
self.addInventoryItem = function
มองหา
TriggerClientEvent('esx:addInventoryItem', self.source, item, count)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendInventoryItem', 'add', item.name, count, self.source)
self.removeInventoryItem
ค้นหา
self.removeInventoryItem = function
มองหา
TriggerClientEvent('esx:removeInventoryItem', self.source, item, count)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendInventoryItem', 'remove', item.name, count, self.source)
self.setInventoryItem
ค้นหา
self.setInventoryItem = function
มองหา
item.count = count
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendInventoryItem', 'set', item.name, count, self.source)
self.addWeapon
ค้นหา
self.addWeapon = function
มองหา
TriggerClientEvent('esx:addInventoryItem', self.source, {label = weaponLabel}, 1)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeapon', 'add', weaponName, ammo, self.source)
self.addWeaponComponent
ค้นหา
self.addWeaponComponent = function
มองหา
TriggerClientEvent('esx:addWeaponComponent', self.source, weaponName, weaponComponent)
เพิ่มรหัสนี้ไว้ด้านล่าง
local component = ESX.GetWeaponComponent(weaponName, weaponComponent)
if component then
TriggerEvent('azael_ui-itemnotify:sendWeaponComponent', 'add', component.name, component.label, self.source)
end
self.removeWeapon
ค้นหา
self.removeWeapon = function
มองหา
local weaponLabel
เพิ่มรหัสนี้ไว้ด้านล่าง
local weaponAmmo
มองหา
weaponLabel = v.label
เพิ่มรหัสนี้ไว้ด้านล่าง
weaponAmmo = v.ammo
มองหา
TriggerClientEvent('esx:removeInventoryItem', self.source, {label = weaponLabel}, 1)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeapon', 'remove', weaponName, weaponAmmo, self.source)
self.removeWeaponComponent
ค้นหา
self.removeWeaponComponent = function
มองหา
TriggerClientEvent('esx:removeWeaponComponent', self.source, weaponName, weaponComponent)
เพิ่มรหัสนี้ไว้ด้านล่าง
local component = ESX.GetWeaponComponent(weaponName, weaponComponent)
if component then
TriggerEvent('azael_ui-itemnotify:sendWeaponComponent', 'remove', component.name, component.label, self.source)
end
การติดตั้งใน es_extended v1.2.x
es_extended เวอร์ชั่น v1.2.x
จะใช้ระบบ weigh
หากเซิร์ฟเวอร์ของคุณใช้เวอร์ชั่นนี้อยู่ ให้คุณไปที่ es_extended/server/classes/player.lua
และดำเนินการติดตั้งรหัสทริกเกอร์ เพื่อส่งกิจกรรมมายังทรัพยากร azael_ui-itemnotify
ตามขั้นตอนด้านล่างนี้
es_extended/fxmanifest.lua
self.setAccountMoney
ค้นหา
self.setAccountMoney = function
มองหา
self.triggerEvent('esx:setAccountMoney', account)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendAccountMoney', 'set', accountName, money, self.source)
self.addAccountMoney
ค้นหา
self.addAccountMoney = function
มองหา
self.triggerEvent('esx:setAccountMoney', account)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendAccountMoney', 'add', accountName, money, self.source)
self.removeAccountMoney
ค้นหา
self.removeAccountMoney = function
มองหา
self.triggerEvent('esx:setAccountMoney', account)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendAccountMoney', 'remove', accountName, money, self.source)
self.addInventoryItem
ค้นหา
self.addInventoryItem = function
มองหา
self.triggerEvent('esx:addInventoryItem', item.name, item.count)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendInventoryItem', 'add', item.name, count, self.source)
self.removeInventoryItem
ค้นหา
self.removeInventoryItem = function
มองหา
self.triggerEvent('esx:removeInventoryItem', item.name, item.count)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendInventoryItem', 'remove', item.name, count, self.source)
self.setInventoryItem
ค้นหา
self.setInventoryItem = function
มองหา
count = ESX.Math.Round(count)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendInventoryItem', 'set', item.name, count, self.source)
self.addWeapon
ค้นหา
self.addWeapon = function
มองหา
self.triggerEvent('esx:addInventoryItem', weaponLabel, false, true)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeapon', 'add', weaponName, ammo, self.source)
self.addWeaponComponent
ค้นหา
self.addWeaponComponent = function
มองหา
self.triggerEvent('esx:addInventoryItem', component.label, false, true)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeaponComponent', 'add', component.name, component.label, self.source)
self.addWeaponAmmo
ค้นหา
self.addWeaponAmmo = function
มองหา
self.triggerEvent('esx:setWeaponAmmo', weaponName, weapon.ammo)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeaponAmmo', 'add', weaponName, ammoCount, self.source)
self.removeWeapon
ค้นหา
self.removeWeapon = function
มองหา
local weaponLabel
เพิ่มรหัสนี้ไว้ด้านล่าง
local weaponAmmo
มองหา
weaponLabel = v.label
เพิ่มรหัสนี้ไว้ด้านล่าง
weaponAmmo = v.ammo
มองหา
self.triggerEvent('esx:removeInventoryItem', weaponLabel, false, true)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeapon', 'remove', weaponName, weaponAmmo, self.source)
self.removeWeaponComponent
ค้นหา
self.removeWeaponComponent = function
มองหา
self.triggerEvent('esx:removeInventoryItem', component.label, false, true)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeaponComponent', 'remove', component.name, component.label, self.source)
self.removeWeaponAmmo
ค้นหา
self.removeWeaponAmmo = function
มองหา
self.triggerEvent('esx:setWeaponAmmo', weaponName, weapon.ammo)
เพิ่มรหัสนี้ไว้ด้านล่าง
TriggerEvent('azael_ui-itemnotify:sendWeaponAmmo', 'remove', weaponName, ammoCount, self.source)
ยกเลิกการใช้งาน
- เปิดไฟล์
server.cfg
ค้นหาensure azael_ui-itemnotify
- ทำการเพิ่ม
#
ไว้ข้างหน้าensure azael_ui-itemnotify
ตัวอย่าง:
#ensure azael_ui-itemnotify