GetPlayerNametagText: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 27: Line 27:
This example does...
This example does...
<!-- 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 -->
This will announce whenever a player enters a car
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
addEventHandler ( "onVehicleEnter", root, "VehicleEnter" )
blabhalbalhb --abababa
function VehicleEnter ( player, seat, jacked )
--This line does this...
playersname = getPlayerNametagText ( player )
mooo
--Store the name of the person who entered the car
outputChatBox ( playersname.." entered a car!" )
--output the name tag of the person who entered the car
end
</syntaxhighlight>
</syntaxhighlight>



Revision as of 06:20, 11 April 2007

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

Syntax

string getPlayerNametagText ( player thePlayer )

Required Arguments

  • argumentName: description

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • argumentName2: description
  • argumentName3: description

Returns

Returns true if blah, false otherwise.

Example

This example does... This will announce whenever a player enters a car

addEventHandler ( "onVehicleEnter", root, "VehicleEnter" )
function VehicleEnter ( player, seat, jacked )
playersname = getPlayerNametagText ( player )
--Store the name of the person who entered the car
outputChatBox ( playersname.." entered a car!" )
--output the name tag of the person who entered the car
end

See Also

Template:FunctionArea functions -- leave this unless you complete the function