GetClientName

From Multi Theft Auto: Wiki
Revision as of 22:12, 22 July 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function returns a string containing the name of the client.

Syntax

string getClientName ( client theClient )

Required Arguments

  • theClient: The client element (player or admin) you want to get the name of.

Returns

Returns a string containing the requested client's name, or false if the client passed to the function is invalid.

Example

This example finds a player with an ID of 1 and if the player exists, they are killed.

-- Find the player with ID 1.
myPlayer = getPlayerFromID ( 1 )
-- If there is a player with an ID of 1 then...
if ( myPlayer ~= false ) then
	-- Try to kill the player, if it is successful then
	if ( killPlayer ( myPlayer ) ) then
		-- Tell everyone about it!
		outputServerChatBox ( "He shouldn't have had that ID. ", getClientName ( myPlayer ) , " has bitten the dust." )
	end
end

See Also