AR/setPlayerNametagShowing

From Multi Theft Auto: Wiki
Revision as of 13:52, 24 March 2016 by Jaber (talk | contribs) (Created page with "__NOTOC__ {{Server client function}} {{New feature|3|1.0|هذه الوظيفة تستخدم لحذف واظهار اسم الاعب الذي يكون عليه}} ==Syntax== ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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


Syntax

bool setPlayerNametagShowing ( player thePlayer, bool showing )

OOP Syntax Help! I don't understand this!

Method: player:setNametagShowing(...)
Variable: .nametagShowing
Counterpart: isPlayerNametagShowing


Required Arguments

  • thePlayer: Define the player whos tag visiblity status you want to change
  • showing: Use true or false to show/hide the tag

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