[Release] Holograms / Floating text

Hi there,

this is my first, very small script, it lets you set holograms / floating text wherever you want.
By default, the holograms are only visible if you are within 10m from them.
It could be used to display rules, contact info or whatever at the spawn, for example.
Its customizable, too.

Github
List of Fonts

Some pictures:



Changelog:

v1.2
made it easier to set up

v1.1
fix and config file by Parow

v1.0
release

17 Likes

Moved to #development:releases

1 Like

Its not working for me. I just copy pasted it into my resources and started it via server.cfg.

Then i changed the coords here the code.

-- Holograms / floating text Script by Meh
-- Just put in the coordinates you get when standing on the ground, it's above the ground then
-- By default, you only see the hologram when you are within 10m of it.
-- The Default holograms are at the Observatory.
-- You can change the font by changing the first number after the "text".

Citizen.CreateThread(function()
    Holograms()
end)

function Holograms()
		while true do
			Citizen.Wait(0)

			-- Hologram No. 1
		if GetDistanceBetweenCoords( 223.8378, -804.9171, 30.636, GetEntityCoords(LocalPed())) < 10.0 then
			Draw3DText( 223.8378, -804.9171, 30.636  -1.400, "Your",4,0.15,0.1)
			Draw3DText( 223.8378, -804.9171, 30.636  -1.600, "text",4,0.15,0.1)
			Draw3DText( 223.8378, -804.9171, 30.636  -1.800, "here",4,0.15,0.1)		
		end

			--Hologram No. 2
		if GetDistanceBetweenCoords( 220.196, -809.1941, 31.600, GetEntityCoords(LocalPed())) < 10.0 then
			Draw3DText( 220.196, -809.1941, 31.000  -1.400, "Discord: discord.me/HailTheSnail",4,0.15,0.1)
			Draw3DText( 220.196, -809.1941, 30.400  -1.600, "Website: www.BadExample.com",4,0.15,0.1)
			Draw3DText( 220.196, -809.1941, 30.800  -1.800, "Twitter: @Example",4,0.15,0.1)		
		end	
	end
end
1 Like

Because he havent the Draw3DText function in the script.

I did a pull request to fix all bug :slight_smile: and add config file

1 Like

Thank you.
I played around with this in another resource that had the Draw3DText thing, and saw that nobody released standalone holograms yet, so i tried to put it together, but since i’m bad at coding… well :sweat_smile:

@Meh

Alright. I’ve got it in my server, and it looks awesome! This is gonna be helpful.

There’s one thing though. I can’t figure out how to add another line of text.

Where I can find a list of fonts available?

Great plugin mate!!
Anyway to have an on the fly font change?

@Yufai
Download the updated script, easier to set up.

@Lucas_R
I linked a list of fonts in the top post.

@CruelAlpha
On the fly is possible. Set the font you want, restart the resource, done.

How add more holograms in config.lua ? Example please!

Download the newest version. It doesn’t have a config lua anymore but is easier to set up.
Everything i could think of is explained in the new .lua file

1 Like

Works perfect for informing new players for key binds or contact! :slight_smile:
Could You please add feature that let us color separate words in a hologram instead of coloring all of them? Thanks! :smiley:

this is dope, gotta try it out.

Is there a way I can add a background to the text?

@katysz I dont think i can do that, since my coding abilities are … very little :sweat_smile: sorry

@x1mart no

Well, it’s possible because I saw people doing it, just don’t know how. :confused:

What i meant was that i dont know how to add a background, and i didnt see it anywhere before.

I found a way to do it, I used DrawRect to draw a rectangle behind the text and it works perfectly.

1 Like

LUL! , DrawRect work only on your screen position , it’s not like a Vector coordinate x,y,z world lul!!