AR/setPlayerNametagShowing: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
bool setPlayerNametagShowing ( player thePlayer, bool showing )
bool setPlayerNametagShowing ( player thePlayer, bool showing )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[player]]:setNametagShowing|nametagShowing|isPlayerNametagShowing}}
 


===Returns===
===Returns===

Revision as of 13:53, 24 March 2016

هذه الوظيفة تستخدم لحذف واظهار اسم الاعب الذي يكون عليه


Syntax

bool setPlayerNametagShowing ( player thePlayer, bool showing )


Returns

Returns true if successful, false otherwise

Example

This script will turn off player tags for everyone

function onResourceStart ( )
    local players = getElementsByType ( "player" ) -- Store all the players in the server into a table
    for key, player in ipairs ( players ) do       -- for all the players in the table
        setPlayerNametagShowing ( player, false )  -- turn off their nametag
    end
end
addEventHandler ( "onResourceStart", resourceRoot, onResourceStart )

function onPlayerJoin ( )
      -- Whoever joins the server should also have their nametags deactivated
	setPlayerNametagShowing ( source, false )
end
addEventHandler ( "onPlayerJoin", root, onPlayerJoin )

See Also

Shared