Customize vehicle

ในตัวอย่างนี้จะใช้ร้านปรับแต่งรถของ esx_lscustom เป็นหลัก

เมื่อการปรับแต่งรถเสร็จสิ้น และมีการเปลี่ยนแปลงรายละเอียดที่ตัวรถ ไม่ว่าจะเป็น สี ล้อ หรือ อื่นๆ จะต้องมีการใช้ Function พิเศษ เพื่อให้ ZOBYETEAM_GARAGE รับรู้ว่ามีการเปลี่ยนแปลงรายละเอียดที่ตัวรถ ดังตัวอย่าง บรรทัดที่ 6

esx_lscustom (client)
RegisterNetEvent('esx_lscustom:installMod')
AddEventHandler('esx_lscustom:installMod', function()
    local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
    myCar = ESX.Game.GetVehicleProperties(vehicle)
    TriggerServerEvent('esx_lscustom:refreshOwnedVehicle', myCar)
    exports['zobyeteam_garage']:saveProps()
end)

สำหรับ Function "saveProps" จะไม่มีการรับค่าใดๆ สำหรับการเรียกใช้จากทรัพยากรอื่นๆสามารถ ทำได้ดังตัวอย่าง:

exports['zobyeteam_garage']:saveProps()

Last updated