GetClientName: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Needs_Checking|Outdated example? what is that get from id crap?--[[User:Ransom|Ransom]] 02:47, 25 April 2007 (CDT)}}
__NOTOC__
__NOTOC__
This function returns a string containing the name of the client.
This function returns a string containing the name of the client.

Revision as of 07:47, 25 April 2007

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 :