[Release] Street Label

alright it’s all good now.

I was only replacing and /restart it and it kinda messing up the file i guess. restarted the server and delete the cache did the trick.

Works great and with no issues now. have a nice day and keep being awesome @lowheartrate

1 Like

umm really sorry for bothering you again. i tested it with my friends and it seems like the streetlabel disappear when “my character” walking and show when in car (As intended).

But on my friend end it “always disable” until “my character” get in the car and when i get out of the car it disappear on my friend side and doesn’t show up when my friend inside the car.

tl:dr : it kinda show/hidden depend on “my character” instead of each players whenever they inside the car.

Not sure if I understand your issue entirely but try replacing client.lua:141:

local ped = GetPlayerPed()

with

local ped = GetPlayerPed(-1)

Seems to work fine for me but can’t confirm with other players at the moment and don’t want to push an update to the github without knowing its entirely fixed.

I think i got how i wanted probably

if IsPedInAnyVehicle(PlayerPedId(), true) then

Below the function drawTxt so the text will only appear when you in a car but this wont allow you to on/off using config.

because

IsPedInAnyVehicle(ped, true) then

should be

IsPedInAnyVehicle(ped, false) then

as the last parameter toggles rather or not it should use the players last vehicle. You only want to use the vehicle if the ped is in the vehicle.

i only want it to trigger the “text” when player is in the car so it will disappear when they out of the car.

I’m don’t really know well about coding so i kinda not sure what you meant by the toggle.

function drawTxt(x,y ,width,height,scale, text, r,g,b,a)
	if IsPedInAnyVehicle(PlayerPedId(), true) then
		SetTextFont(4)
		SetTextProportional(0)
		SetTextScale(scale, scale)
		SetTextColour(r, g, b, a)
		SetTextDropShadow(0, 0, 0, 0,255)
		SetTextEdge(1, 0, 0, 0, 255)
		SetTextDropShadow()
		SetTextOutline()
		SetTextEntry("STRING")
		AddTextComponentString(text)
		DrawText(x - width/2, y - height/2 + 0.005)
	end

this is the coding i’m using at the moment. working fine for now but didn’t try yet with my friend. will update about it tomorrow.

Where exactly are you grabbing this code from? The github repository, the drawTxt function looks like:


function drawTxt(x,y ,width,height,scale, text, r,g,b,a)
	if not HideHud then
		SetTextFont(4)
		SetTextProportional(0)
		SetTextScale(scale, scale)
		SetTextColour(r, g, b, a)
		SetTextDropShadow(0, 0, 0, 0,255)
		SetTextEdge(1, 0, 0, 0, 255)
		SetTextDropShadow()
		SetTextOutline()
		SetTextEntry("STRING")
		AddTextComponentString(text)
		DrawText(x - width/2, y - height/2 + 0.005)
	end
end

If you continue to have issues with it please PM me to resolve it or add me on discord: lowheartrate#1778

UPDATE: v1.1.1: Fixed per player issue

  • Fixed issue where it would show the HUD for everyone when a single person enters a vehicle instead of only showing to the player(s) that are in a vehicle.

Download the latest release

i added it to my resources folder and server.cfg but still don’t see it in game

By default

checkForVehicle = true

in the config.lua. It will only show the HUD when you are in a vehicle. I have tested it in my server and works fine.

i changed the statement to false but thanks anyways:smiley:

does anyone have a preset for this to work with nearest postal without overlapping?

You can adjust the x and y axis in the config.lua file to change the position of the hud.

Thank you, Ive got it to fit perfectly

1 Like

How to make StreetLabel work only in the car?

It is set to only show while in a vehicle by default. Check the config.lua file to make sure

checkForVehicle = true

Still no one managed to disable the default hud at bottom right completely?

You can bypass the default HUD in the bottom by disabling the HUD in your settings.

Just created a new PR, adding what @markmozza wished for :slight_smile:

With this, the bottom right now looks like:
image

(I lowered the vehicle info to make up for the lack of street info now)

1 Like

Can anyone give me the coords to place the GUI above the Minimap?