IsPlayerNametagShowing: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
This fake function is for use with blah & blah and does blahblahblabhalbhl
This function will allow you to determine if a player's name tag is currently showing.


==Syntax==  
==Syntax==  
Line 11: Line 11:
===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 -->
<!-- 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 -->
*'''argumentName:''' description
*'''thePlayer:''' The player whose current name tag condition you want to check
 
<!-- 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 -->
<!-- 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 blah, ''false'' otherwise.
Returns ''true'' if the player's name tag is showing, ''false'' otherwise.


==Example==  
==Example==  
Line 28: Line 22:
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
addCommandHandler ( "nametagstatus", "outputTagStatus" )
blabhalbalhb --abababa
function outputTagStatus ( player, commandName )
--This line does this...
tagstatus = isPlayerNametagShowing ( player )
mooo
--Asks if the commandhandler activator's tag is showing and stores
--it to tagstatus as true or false
if tagstatus == true then
outputChatBox ( "Your tag is visible" )
--output that name tag is showing because tagstatus is true
else
outputChatBox ( "Your tag is not visible" )
--output that name tag is not showing because tagstatus is false
end
end
</syntaxhighlight>
</syntaxhighlight>


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

Revision as of 04:09, 11 April 2007

This function will allow you to determine if a player's name tag is currently showing.

Syntax

bool isPlayerNametagShowing ( player thePlayer )

Required Arguments

  • thePlayer: The player whose current name tag condition you want to check

Returns

Returns true if the player's name tag is showing, false otherwise.

Example

This example does...

addCommandHandler ( "nametagstatus", "outputTagStatus" )
function outputTagStatus ( player, commandName )
tagstatus = isPlayerNametagShowing ( player )
--Asks if the commandhandler activator's tag is showing and stores
--it to tagstatus as true or false
	if tagstatus == true then
	outputChatBox ( "Your tag is visible" )
	--output that name tag is showing because tagstatus is true
	else
	outputChatBox ( "Your tag is not visible" )
	--output that name tag is not showing because tagstatus is false
	end
end

See Also

-- leave this unless you complete the function