πŸ“±D-Phone

Tested with version from 11/22

πŸ“± If you use d-phone

Everything should works fine for you, without anychanges!

if not then change /d-phone/client/client.lua - line 176

Citizen.CreateThread(function()
    while true do
		Citizen.Wait(0)
		if IsControlJustReleased(0, 288) then
			if firstTime == true then
				TriggerServerEvent("d-phone:server:setvalues", GetPlayerServerId(PlayerId()), Config.backgroundurl, Config.darkbackgroundurl)
				SendNUIMessage({
					setvalues = true,
					backgroundurl = Config.backgroundurl ,
					darkbackgroundurl = Config.darkbackgroundurl ,
				})
				firstTime = false
			end
			
			
			if incall == true and phoneopen == true then 
				SendNUIMessage({
					hidePhone = true
				})
				phoneopen = false 
			else
				if isprogess == false then
					TriggerServerEvent("d-phone:server:checkphone", GetPlayerServerId(PlayerId()))
					isprogess = true
					Wait(100)
					if hasphone == true then
						DoPhoneAnimation('cellphone_text_in')
						if hasnumber == false then
							TriggerServerEvent("d-phone:server:checkphonenumber", GetPlayerServerId(PlayerId()))
						end
						Wait(100)

						TriggerServerEvent("d-phone:server:getphonedata", GetPlayerServerId(PlayerId()))
						TriggerServerEvent("d-phone:server:loadcontact", GetPlayerServerId(PlayerId()))
						newPhoneProp()
						
					else
						isprogess = false
						TriggerEvent("d-notification", _U("needphone"))
					end
				end
			end
		end
    end
end)

to this:

Citizen.CreateThread(function()
    while true do
		Citizen.Wait(0)
		if IsControlJustReleased(0, 288) then
		-- mfp-phonebattery --
        ESX.TriggerServerCallback('mfp_phonebattery:getBatteryStatus', function(result)
            if result then
		-- mfp-phonebattery --
			if firstTime == true then
				TriggerServerEvent("d-phone:server:setvalues", GetPlayerServerId(PlayerId()), Config.backgroundurl, Config.darkbackgroundurl)
				SendNUIMessage({
					setvalues = true,
					backgroundurl = Config.backgroundurl ,
					darkbackgroundurl = Config.darkbackgroundurl ,
				})
				firstTime = false
			end
			
			
			if incall == true and phoneopen == true then 
				SendNUIMessage({
					hidePhone = true
				})
				phoneopen = false 
			else
				if isprogess == false then
					TriggerServerEvent("d-phone:server:checkphone", GetPlayerServerId(PlayerId()))
					isprogess = true
					Wait(100)
					if hasphone == true then
						DoPhoneAnimation('cellphone_text_in')
						if hasnumber == false then
							TriggerServerEvent("d-phone:server:checkphonenumber", GetPlayerServerId(PlayerId()))
						end
						Wait(100)

						TriggerServerEvent("d-phone:server:getphonedata", GetPlayerServerId(PlayerId()))
						TriggerServerEvent("d-phone:server:loadcontact", GetPlayerServerId(PlayerId()))
						newPhoneProp()
						
					else
						isprogess = false
						TriggerEvent("d-notification", _U("needphone"))
					end
				end
			end
		-- mfp-phonebattery --
		else
			ESX.ShowNotification("~r~The phone battery is empty now. Recharge first!")
		end
		end)
		-- mfp-phonebattery --
		end -- if pressed
    end
end)

But in general everything should work fine without any changes! (tested with older version...)

Last updated