[JS] Nametags

Started by Vortrex, April 05, 2018, 11:09:37 AM

Previous topic - Next topic

Vortrex

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:
  • Download the resource. Link is above
  • Unzip it, and place the "v-nametags" folder into the main resources folder of your server.
  • Add the resources you want to server.xml. More info for that  [url=https://wiki.gtaconnected.com/ServerConfigurationon the wiki.[/url]
  • Either start or restart your server. If it's already running, load the resource with /refresh then /start v-nametags

Vortrex

#1
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



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!