Edit.lua

This file contains notifications and progress bars. You can change it with your own progress bar or notification script.

RegisterNetEvent("samy-nitro:changenotify")
AddEventHandler("samy-nitro:changenotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'success', text = Config.Notification['change'], length = 3500})
end)

RegisterNetEvent("samy-nitro:changetwonotify")
AddEventHandler("samy-nitro:changetwonotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'success', text = Config.Notification['changetwo'], length = 3500})
end)

RegisterNetEvent("samy-nitro:nofuelnotify")
AddEventHandler("samy-nitro:nofuelnotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'error', text = Config.Notification['no_fuel'], length = 3500})
end)


RegisterNetEvent("samy-nitro:tupefuelnotify")
AddEventHandler("samy-nitro:tupefuelnotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'success', text = Config.Notification['emptynitrotuberefill'], length = 3500})
end)


RegisterNetEvent("samy-nitro:fullnitronotify")
AddEventHandler("samy-nitro:fullnitronotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'error', text = Config.Notification['fullnitro'], length = 3500})
end)


RegisterNetEvent("samy-nitro:maxnitronotify")
AddEventHandler("samy-nitro:maxnitronotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'error', text = Config.Notification['max_nitro'], length = 3500})
end)


RegisterNetEvent("samy-nitro:novehiclenotify")
AddEventHandler("samy-nitro:novehiclenotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'error', text = Config.Notification['no_vehicles'], length = 3500})
end)

RegisterNetEvent("samy-nitro:emptynitrotubenotify")
AddEventHandler("samy-nitro:emptynitrotubenotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'error', text = Config.Notification['emptynitrotube'], length = 3500})
end)


RegisterNetEvent("samy-nitro:noemptynitrotubenotify")
AddEventHandler("samy-nitro:noemptynitrotubenotify", function ()
  TriggerEvent('mythic_notify:client:SendAlert', { type = 'error', text = Config.Notification['noemptynitrotube'], length = 3500})
end)


RegisterNetEvent("samy-nitro:refueling")
AddEventHandler("samy-nitro:refueling", function()
  exports['mythic_progbar']:Progress({
    name = "refueling",
    duration = Config.nitrorefilltime,
    label = Config.carnitrorefuelingtext,
    useWhileDead = false,
    canCancel = false,
    controlDisables = {
        disableMovement = Config.disableMovement,
        disableCarMovement = Config.disableCarMovement,
        disableMouse = Config.disableMouse,
        disableCombat = Config.disableCombat,
    },

  }, function(cancelled)
      if cancelled then
        loading_nitro = true   --It is the function that fills the Nitro Level.
      end
  end)
end)



RegisterNetEvent("samy-nitro:tuperefueling")
AddEventHandler("samy-nitro:tuperefueling", function ()
    exports['mythic_progbar']:Progress({
      name = "tuperefueling",
      duration = Config.emptynitrorefilltime,
      label = Config.emptytuberefuelingtext,
      useWhileDead = false,
      canCancel = false,
      controlDisables = {
          disableMovement = true,
          disableCarMovement = true,
          disableMouse = false,
          disableCombat = true,
      },

  }, function(cancelled)
      if not cancelled then
        TriggerServerEvent("samy-nitro:add_nitro_item")  --TriggerEvent that gives nitro item on it
      end
  end)
end)

Last updated