[FREE RELEASE] Draw text UI

Thank you for sharing this for free

4 Likes

Hope you like it. :smiley:

We also hope to see some images of sick css redesigns :grinning:

2 Likes

Amazing.

2 Likes

Not bad.

2 Likes

Thanks for share, its amazing, btw whats that HUd you are using?

2 Likes

If you mean carhud it’s this: [RELEASE] [PAID] Codesign highly customisable Car HUD - Releases - Cfx.re Community

By the way, good job @Codesign

3 Likes

I use this notification system, on my server and it works perfectly, super fast and hardly consumes

2 Likes

May i Ask is there a video explaining how to do it… as i use grp core i dont know if i can use it on there doorlocking system

1 Like

There’s no video. We do have a readme file you can check out Drawtext UI - Codesign Scripts

heyy bro
good job bro

can u help me for this plz ?

heey 

Citizen.CreateThread(function()

    while true do

        Citizen.Wait(0)

        local playerCoords, awayFromDoors = GetEntityCoords(GetPlayerPed(-1)), true

        for k,doorID in ipairs(QB.Doors) do

            local distance

            if doorID.doors then

                distance = #(playerCoords - doorID.doors[1].objCoords)

            else

                distance = #(playerCoords - doorID.objCoords)

            end

            if doorID.distance then

                maxDistance = doorID.distance

            end

            if distance < 50 then

                awayFromDoors = false

                if doorID.doors then

                    for _,v in ipairs(doorID.doors) do

                        FreezeEntityPosition(v.object, doorID.locked)

                        if doorID.locked and v.objYaw and GetEntityRotation(v.object).z ~= v.objYaw then

                            SetEntityRotation(v.object, 0.0, 0.0, v.objYaw, 2, true)

                        end

                    end

                else

                    FreezeEntityPosition(doorID.object, doorID.locked)

                    if doorID.locked and doorID.objYaw and GetEntityRotation(doorID.object).z ~= doorID.objYaw then

                        SetEntityRotation(doorID.object, 0.0, 0.0, doorID.objYaw, 2, true)

                    end

                end

            end

            if distance < maxDistance then

                awayFromDoors = false

                if doorID.size then

                    size = doorID.size

                end

                local isAuthorized = IsAuthorized(doorID)

                if isAuthorized then

                    if doorID.locked then

                        displayText = "[E] - closed   "   .. k

                    elseif not doorID.locked then

                        displayText = "[E] - opened   "   .. k

                    end

                elseif not isAuthorized then

                    if doorID.locked then

                        displayText = "press e   "   .. k

                    elseif not doorID.locked then

                        displayText = "press e   "   .. k

                    end

                end

                if doorID.locking then

                    if doorID.locked then

                        displayText = ".opening"

                    else

                        displayText = ".opening"

                    end

                end

                if doorID.objCoords == nil then

                    doorID.objCoords = doorID.textCoords

                end

                DrawText3Ds(doorID.objCoords.x, doorID.objCoords.y, doorID.objCoords.z, displayText)

                --print(k)

                if IsControlJustReleased(0, 38) then

                    if isAuthorized then

                        setDoorLocking(doorID, k)

                    end

                end

            end

        end

        if awayFromDoors then

            Citizen.Wait(1000)

        end

    end

end)
2 Likes

10/10 very optimized and it is free can’t get any better :slight_smile:

2 Likes

Sooo Amazinnng !! Thank you

2 Likes

@C4_Peerless the easiest way to use this, is just to copy one of the example templates and paste your code into it

1 Like

Hey bro, im having a problem, i can set up everything and the notification shows all good , but if i stand there i keeps like popping up ( flashing ), appreciate any help thanks

1 Like

@Joao_Gargalo Id recommend using the templates provided in the read me and then adding your code to it - Drawtext UI - Codesign Scripts

1 Like

I’ve tryied everything now, could you help me pls

Citizen.CreateThread(function()
	local sleep = 500
	while true do
		Citizen.Wait(sleep)
		local playerCoords = GetEntityCoords(PlayerPedId())

		for i=1, #Config.DoorList do
			local doorID   = Config.DoorList[i]
			local distance = GetDistanceBetweenCoords(playerCoords, doorID.objCoords.x, doorID.objCoords.y, doorID.objCoords.z, true)

			local maxDistance = 1.25
			if doorID.distance then
				maxDistance = doorID.distance
			end

			if (distance < (maxDistance+55)) then
				--if (distance < (maxDistance+25)) then
					--if (distance < (maxDistance+5)) then

						sleep = 5
						local isAuthorized = IsAuthorized(doorID)
						ApplyStateLock(doorID)
						local size = 1

						if doorID.size then
							size = doorID.size
						end
						if (distance < maxDistance) then
							if  IsControlJustReleased(1,  38) and isAuthorized then
								if doorID.locked == true then
									local active = true
									local swingcount = 0
									TriggerEvent("dooranim")
									doorID.locked = false
									while active do
										Citizen.Wait(7)

										locked, heading = GetStateOfClosestDoorOfType(GetHashKey(doorID.objName, doorID.objCoords.x, doorID.objCoords.y, doorID.objCoords.z)) 
										heading = math.ceil(heading * 100) 
										DrawText3DTest(doorID.textCoords, "A Destrancar", size)
										
										local dist = GetDistanceBetweenCoords(GetEntityCoords(PlayerPedId()), doorID.objCoords.x, doorID.objCoords.y, doorID.objCoords.z, true)
										local dst2 = GetDistanceBetweenCoords(GetEntityCoords(PlayerPedId()), 1830.45, 2607.56, 45.59,true)

										if heading < 1.5 and heading > -1.5 then
											swingcount = swingcount + 1
										end             
										if dist > 150.0 or swingcount > 100 or dst2 < 200.0 then
											active = false
										end
									end

								elseif doorID.locked == false then

									local active = true
									local swingcount = 0
									TriggerEvent("dooranim")
									doorID.locked = true
									while active do
										Citizen.Wait(1)
										DrawText3DTest(doorID.textCoords, "A Trancar", size)
										swingcount = swingcount + 1
										if swingcount > 100 then
											active = false
										end
									end

								end
								TriggerServerEvent('irp_doorlock:updateState', i, doorID.locked)
							end

							if doorID.locked and isAuthorized then 
								closestString = "[~g~E~w~] - ~r~TRANCADA"
								DrawText3DTest(doorID.textCoords, closestString, size) 
							elseif doorID.locked == false and isAuthorized then 
								closestString = "[~g~E~w~] - ~g~DESTRANCADA"
								DrawText3DTest(doorID.textCoords, closestString, size) 
							end
							break
						end
					--else
					--	sleep = 500
					--end
			---	else
			--		sleep = 1500
			--	end
			else
				sleep = 2500
			end
		end
	end
end)
1 Like

Hi, can i ask where i must code paste like: client.lua, _resource or server.lua? and how event must be in here TriggerEvent(‘add your event here’) for open bank. Script new_banking.

1 Like

Read the read me’s, there are copy and paste templates you can use

1 Like

This is exactly what this script does because I don’t really understand it?

3 Likes

Awesome release!

  • If you guys could add it so you can have multiple text running in different locations of your screen at the same time it would be even better
1 Like