Jump to content

Text above every players head?


cokacola

Recommended Posts

Hello again everyone, just got a quick question, is it possible to put text above every players head, like MTA does with the player name and health bar?

I wanted to display the speed and wanted level, so for example, if the players speed was 145 and his wanted level was 4 it would show this above his head(floating as he walks, like his name does):

[4]145

Now, is there any text function capable of achieving this?

Link to comment

Actually, this is possible without having to write a whole bunch of code for your own nametags - but with 1 limitation. You have to put your added info below their health bar, not above - or move their name below their healthbar.

Using setPlayerNametagText and the \n escape character (newline) you can add extra data to the nametags. It's simple string manipulation. Make sure to run this function serverside to properly sync your changes on every client.

If you prefer more control, the Race gamemode creates it's own nametags with dxDrawText, so you could probably learn from that code.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...