GetPlayerSkin: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 25: Line 25:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function checkSkin ( source, commandName )
function checkSkin ( source, commandName )
outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( source )", source )
outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( source ), source )
end
end
addCommandHandler ( "skin", checkSkin )
addCommandHandler ( "skin", checkSkin )
Line 34: Line 34:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function checkSkin ( commandName )
function checkSkin ( commandName )
outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( getLocalPlayer() )" )
outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( getLocalPlayer() ) )
end
end
addCommandHandler ( "skin", checkSkin )
addCommandHandler ( "skin", checkSkin )

Revision as of 11:47, 29 September 2007

This function returns an integer containing the ID number of the specified player's skin.

Syntax

int getPlayerSkin ( player thePlayer )

Required Arguments

  • player: The player whose skin ID you want to retrieve.

Returns

Returns an int indicating which skin the player has. See Character Skins.

Example

Click to collapse [-]
Server

Example 1: This example spawns a player and tells him his skin

-- Spawn a player 
if ( spawnPlayer ( myPlayer, 1000, 1000, 1000, 90, 650 ) ) then
	-- Tell the player what skin they've spawned with
	outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( myPlayer ), myPlayer )
end

Example 2: This example adds a "skin" command in console, which tells the player his/her skin.

function checkSkin ( source, commandName )
	outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( source ), source )
end
addCommandHandler ( "skin", checkSkin )
Click to collapse [-]
Client

This example adds a "skin" command in console, which tells the player his/her skin.

function checkSkin ( commandName )
	outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( getLocalPlayer() ) )
end
addCommandHandler ( "skin", checkSkin )

See Also