GTA Connected

Scripting => Scripting Releases => Topic started by: Vortrex on April 05, 2018, 11:09:37 AM

Title: [JS] Nametags
Post by: Vortrex on April 05, 2018, 11:09:37 AM
Hey everybody! Here's a simple release for you today ... nametags! GTA Connected has built in nametags but they're kind of ugly, so I decided to make better looking ones via a resource.



GitHub source:   inside the v-nametags folder.



How to Use:
 (https://github.com/VortrexFTW/gtac_sandboxhttps://github.com/VortrexFTW/gtac_vortrex%5B/url)
Title: Re: [JS] Nametags
Post by: Vortrex on April 19, 2018, 04:23:56 AM
Update from Vortrex:

I know double posting sucks, but I wanted to include a tutorial on how to use a custom font for the nametags, for anybody who wants to customize their server with it. If you have connected to my test server, you might've seen the GTA logo font for the nametags. It's called Pricedown, and it's available http://typodermicfonts.com/pricedown/">  here (//http)



The first thing you need, is a .TTF file for a font (search the web, there are tons of them). Upload the TTF file to your nametags resource directory of your server. Then, add this line to the resource's meta.xml:
<file src="FONTNAMEHERE.ttf" type="client" />Replace FONTNAMEHERE with your font's file name. Next, open client.js, and find this line:
font = lucasFont.createDefaultFont(16.0, "Arial", "Medium");
Replace it with these two lines:
fontFile = openFile("FONTNAMEHERE.ttf", false);
font = lucasFont.createFont(fontFile, 16.0);
Again, replace FONTNAMEHERE with your font's file name.



And there you go! Restart your nametag resource (or start it if it's turned off) and voila!