GetClientName

From Multi Theft Auto: Wiki
Revision as of 07:47, 25 April 2007 by Ransom (talk | contribs)
Jump to navigation Jump to search
Dialog-information.png This article needs checking.

Reason(s): Outdated example? what is that get from id crap?--Ransom 02:47, 25 April 2007 (CDT)


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

BEFORE VERSION 1.0 :