cokacola Posted November 30, 2009 Share Posted November 30, 2009 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
robhol Posted November 30, 2009 Share Posted November 30, 2009 Not a text function, no. You'll need to create an onClientRender handler where you dxDraw the text for any ped that's visible. getPedBonePosition will help as far as positioning it goes. So will getScreenFromWorldPosition. Link to comment
subenji99 Posted November 30, 2009 Share Posted November 30, 2009 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
DakiLLa Posted November 30, 2009 Share Posted November 30, 2009 I think you can take this resource and modify it lil bit with dxDrawText function, then just make your own function to draw text when you need it Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now