SetPlayerNametagShowing: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 8: Line 8:
bool setPlayerNametagShowing ( player thePlayer, bool showing )
bool setPlayerNametagShowing ( player thePlayer, bool showing )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->
*'''thePlayer:''' Define the player whos tag visiblity status you want to change
*'''argumentName:''' description
*'''showing:''' Use true or false to show/hide the tag
 
<!-- Only include this section below if there are optional arguments -->
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' description
*'''argumentName3:''' description


===Returns===
===Returns===
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check -->
Returns ''true'' if tag is showing, ''false'' otherwise.
Returns ''true'' if blah, ''false'' otherwise.


==Example==  
==Example==  
Line 43: Line 37:
addEventHandler ( "onPlayerJoin", root, "PlayerJoin" )
addEventHandler ( "onPlayerJoin", root, "PlayerJoin" )
function PlayerJoin ()
function PlayerJoin ()
setPlayerNametagShowing ( v, false )
setPlayerNametagShowing ( source, false )
--Whoever joins the server should also have their nametags deactivated
--Whoever joins the server should also have their nametags deactivated
end
end
Line 50: Line 44:


==See Also==
==See Also==
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{Player functions}}
{{FunctionArea_functions}}
[[Category:Incomplete]] -- leave this unless you complete the function
[[Category:Incomplete]] -- leave this unless you complete the function

Revision as of 02:02, 11 April 2007

This fake function is for use with blah & blah and does blahblahblabhalbhl

Syntax

bool setPlayerNametagShowing ( player thePlayer, bool showing )


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 tag is showing, false otherwise.

Example

This script will turn off player tags for everyone

root = getRootElement ()
players = {}
--Make a players varible and define it as a table
players = getElementsByType ( "player" )
--Store all the players in the server into the table

addEventHandler ( "onResourceStart", root, "ResourceStart" )
function ResourceStart ( name, root )
	for k,v in players do
	--for all the players in the table
	setPlayerNametagShowing ( v, false )
	--turn off their nametag
	end
end

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

See Also

-- leave this unless you complete the function