Jump to content

[HELP]Health Bar and Nick?


irinel1996

Recommended Posts

Use:
setPlayerNametagShowing 

I have found that:

root = getRootElement() 
    players = getelementByType("player") 
     
    function ResourceStart ( name, root ) 
        for k,v in ipairs ( players ) do 
            setPlayerNametagShowing ( v, false ) 
        end 
    end 
    addEventHandler ( "onResourceStart", root, ResourceStart ) 
  
    function PlayerJoin () 
        setPlayerNametagShowing ( source, false ) 
    end 
    addEventHandler ( "onPlayerJoin", root, PlayerJoin 

But I don't know how to put it in my meta.xml

Can you help me please?

Link to comment

script.lua:

function ResourceStart () 
        for k,v in ipairs (getelementByType("player")) do 
            setPlayerNametagShowing ( v, false ) 
       end 
end 
addEventHandler ( "onResourceStart", resourceRoot, ResourceStart ) 
  
function PlayerJoin () 
       setPlayerNametagShowing ( source, false ) 
end 
addEventHandler ( "onPlayerJoin", root, PlayerJoin) 

meta.xml:

<meta> 
    <script src="script.lua" type="server"/> 
</meta> 

Link to comment

You welcome.

P.S: You can't talk in any other language than English in this forum, you can use this section though to speak Spanish: viewforum.php?f=122

And, type="server" is to define if the script is server side or client side, if you take a look in the MTA wiki you'll see "Client functions, Client events", "Server functions, Server events", some functions only work client side or server side, that's the point for the script type(s).

I'm when it comes to explaining :oops: .

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...