🌐
MFPSCRIPTS- Documentation
  • πŸ”Documentation
  • 🐌Scripts
    • πŸ“±PhoneBattery
      • βš™οΈInstallation
      • ☎️Addidtional Phones
        • πŸ“±RoadPhone
        • πŸ“±GCPhone
        • πŸ“±HighPhone
        • πŸ“±D-Phone
        • πŸ“±NPWD
    • πŸ’ΈBanking
      • βš™οΈInstallation
    • πŸš”Policejob
      • βš™οΈInstallation
      • πŸ”—Script Intergrations
      • πŸ‘¨β€πŸ’»Developers
    • 🚧Progressbar
    • ℹ️Notification
    • πŸ—‘οΈScrapyard
    • 🎬HUD
    • πŸ“²Dispatches-App for LB-Phone
    • πŸ—ΊοΈMFP_AdvancedBlips
  • πŸ₯©Additional
    • βš™οΈINSTALL SCRIPTS
    • πŸ“΄FiveStatus
  • 🚫General Errors
    • πŸ“€es_extended
Powered by GitBook
On this page
  1. Scripts
  2. PhoneBattery
  3. Addidtional Phones

GCPhone

Should work by default!

PreviousRoadPhoneNextHighPhone

Last updated 1 year ago

πŸ“± if you use

Everything should works native, without anychanges!

Still not closed when battery is empty?

if you have problems and/or want to block the command-opening without enough battery then change /gcphone/client/client.lua - line 77

RegisterCommand('phone', function(source) -- Toggles Phone Via Command. Can coment out.
  TooglePhone()
end, false)

--====================================================================================
--  
--====================================================================================
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
    if not menuIsOpen and isDead then
      DisableControlAction(0, 288, true)
    end
    if takePhoto ~= true then
      if IsControlJustPressed(1, Config.KeyOpenClose) then -- On key press, will open the phone
          TooglePhone()
      end
      if menuIsOpen == true then
        for _, value in ipairs(KeyToucheCloseEvent) do
          if IsControlJustPressed(1, value.code) then
            SendNUIMessage({keyUp = value.event})
          end
        end
        if useMouse == true and hasFocus == ignoreFocus then
          local nuiFocus = not hasFocus
          SetNuiFocus(nuiFocus, nuiFocus)
          hasFocus = nuiFocus
        elseif useMouse == false and hasFocus == true then
          SetNuiFocus(false, false)
          hasFocus = false
        end
      else
        if hasFocus == true then
          SetNuiFocus(false, false)
          hasFocus = false
        end
      end
    end
  end
end)lua

to:

RegisterCommand('phone', function(source) -- Toggles Phone Via Command. Can coment out.
  -- mfp-phonebattery --
   ESX.TriggerServerCallback('mfp_phonebattery:getBatteryStatus', function(result)
       if result then
          TooglePhone()
        else
          ESX.ShowNotification("The phone battery is empty now. Recharge first!")
        end
    end)
    -- mfp-phonebattery --
    -- TooglePhone()
end, false)

--====================================================================================
--  
--====================================================================================
Citizen.CreateThread(function()
  while true do
    Citizen.Wait(0)
    if not menuIsOpen and isDead then
      DisableControlAction(0, 288, true)
    end
    if takePhoto ~= true then
      if IsControlJustPressed(1, Config.KeyOpenClose) then -- On key press, will open the phone
          ESX.TriggerServerCallback('mfp_phonebattery:getBatteryStatus', function(result)
               if result then
                  TooglePhone()
                else
                  ESX.ShowNotification("The phone battery is empty now. Recharge first!")
                end
      end)
    -- mfp-phonebattery --
    -- TooglePhone()
      end
      if menuIsOpen == true then
        for _, value in ipairs(KeyToucheCloseEvent) do
          if IsControlJustPressed(1, value.code) then
            SendNUIMessage({keyUp = value.event})
          end
        end
        if useMouse == true and hasFocus == ignoreFocus then
          local nuiFocus = not hasFocus
          SetNuiFocus(nuiFocus, nuiFocus)
          hasFocus = nuiFocus
        elseif useMouse == false and hasFocus == true then
          SetNuiFocus(false, false)
          hasFocus = false
        end
      else
        if hasFocus == true then
          SetNuiFocus(false, false)
          hasFocus = false
        end
      end
    end
  end
end)

t

🐌
πŸ“±
☎️
πŸ“±
gcphone