Jump to content

[HELP]Health Bar and Nick?


irinel1996

Recommended Posts

Posted

Hi!

I want to make disappear the health bar and the nick of the players, like in a RP in SA-MP.

Help me pls. I'm new in MTA.

Thanks all! :)

____________________________

Greetings from Spain.

Posted
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?

Posted

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> 

Posted

Thanks, you've saved me. xD

Thanks a lot. :)

__________________________

Gracias man. Me puedes decir que función tiene el type="server"? Que pasaría si no le pongo eso?

Saludos... :D

Posted

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

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