esx_lscustom
ตัวอย่างรหัสที่ใช้เพิ่มไปยังทรัพยากร esx_lscustom เพื่อส่งข้อมูลมายัง azael_dc-serverlogs
danger
โปรดตรวจสอบตัวแปรของรหัสทุกครั้ง เนื่องจากเวอร์ชันของทรัพยากรในตัวอย่างอาจจะไม่มีความเข้ากันได้กับทรัพยากรในเวอร์ชันที่คุณกำลังใช้งานอยู่ และส่งผลให้ไม่มีการส่งข้อมูลไปยัง azael_dc-serverlogs เนื่องจากมีข้อผิดพลาดเกิดขึ้นจากรหัสที่คุณดำเนินการเพิ่ม
main.lua (Server & Client)
ร้าน-แต่งรถ
Event | Label |
---|---|
LsCustom | ร้าน-แต่งรถ |
ค้นหา
TriggerClientEvent('esx_lscustom:installMod', source)
แก้ไขเป็น
TriggerClientEvent('esx_lscustom:installMod', source, price)
ค้นหา
AddEventHandler('esx_lscustom:installMod', function()
แก้ไขเป็น
AddEventHandler('esx_lscustom:installMod', function(price)
- วางรหัสด้านล่างนี้ต่อจาก
TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar)
บรรทัดที่ 16
pcall(function()
exports['azael_dc-serverlogs']:insertData({
event = 'LsCustom',
content = ('แต่ง ยานพาหนะ %s ทะเบียน %s เสียค่าใช้จ่าย $%s'):format(GetDisplayNameFromVehicleModel(myCar.model), myCar.plate, ESX.Math.GroupDigits(price)),
color = 2
})
end)