Text blinking with Servercallback

Hello, how could i stop the blinking of the text and rect?

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(250)
		ESX.TriggerServerCallback('elva:odo:IsVehicleOwned', function(owned)

		local veh = GetVehiclePedIsIn(PlayerPedId(),false)
		local driver = GetPedInVehicleSeat(veh, -1)

		if (owned == true) or (owned ~= false) then

			if IsPedInAnyVehicle(PlayerPedId(), false) then
				if driver == PlayerPedId() and GetVehicleClass(veh) ~= 13 and GetVehicleClass(veh) ~= 14 and GetVehicleClass(veh) ~= 15 and GetVehicleClass(veh) ~= 16 and GetVehicleClass(veh) ~= 17 and GetVehicleClass(veh) ~= 21 then
					DrawAdvancedText(0.123 - x, 0.774 - y, 0.005, 0.0028, 0.4, round(showKM, 2), 255, 255, 255, 255, 4, 1)
				    DrawAdvancedText(0.155 - x, 0.774 - y, 0.005, 0.0028, 0.4, "ODO", 255, 255, 255, 255, 4, 1)
					drawRct(0.015, 0.759 , 0.050, 0.019, 0,0,0,180)
				end
			else
				Citizen.Wait(750)
			end

		elseif (owned ~= true) and (owned == false) then
			Citizen.Wait(2000)
		end

		end, plate)
	end
end)

Your Citizen.Wait needs to be 10 or less for drawn text not to flash.

0 just makes it go faster

You should not trigger any server callbacks in your draw code, you should do those in a seperate slower thread and then push it into a variable which you then get in your draw code

Hmmm, i have never done this maybe you could show me a example, im trying to learn.

Nevermind, thanks for the help, i did it on the first try.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.