GetPlayerSkin: Difference between revisions
Jump to navigation
Jump to search
(updated to new syntax) |
m (Changed "DeprecatedWithAlt" template to "Deprecated") |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function returns an integer containing the ID number of the | {{Server client function}} | ||
{{Deprecated|getElementModel|}} | |||
This function returns an integer containing the ID number of the specified player's skin. | |||
==Syntax== | ==Syntax== | ||
Line 6: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''player''': The player whose skin you want to retrieve. | *'''player''': The player whose skin ID you want to retrieve. | ||
===Returns=== | ===Returns=== | ||
Returns an [[int]] indicating which skin the player has. See [[ | Returns an [[int]] indicating which skin the player has. See [[Character Skins]]. | ||
==Example== | ==Example== | ||
<section name="Server" class="server " show="true"> | |||
'''Example 1:''' This example spawns a player and tells him his skin | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- Spawn a player | -- Spawn a player | ||
if ( spawnPlayer ( myPlayer, 1000, 1000, 1000, 90, 650 ) ) then | if ( spawnPlayer ( myPlayer, 1000, 1000, 1000, 90, 650 ) ) then | ||
-- Tell the player what skin they've spawned with | -- Tell the player what skin they've spawned with | ||
outputChatBox ( "Your skin ID is: "..getPlayerSkin ( myPlayer ), myPlayer ) | outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( myPlayer ), myPlayer ) | ||
end | |||
</syntaxhighlight> | |||
'''Example 2:''' This example adds a "skin" command in console, which tells the player his/her skin. | |||
<syntaxhighlight lang="lua"> | |||
function checkSkin ( source, commandName ) | |||
outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( source ), source ) | |||
end | |||
addCommandHandler ( "skin", checkSkin ) | |||
</syntaxhighlight> | |||
</section> | |||
<section name="Client" class="client" show="true"> | |||
This example adds a "skin" command in console, which tells the player his/her skin. | |||
<syntaxhighlight lang="lua"> | |||
function checkSkin ( commandName ) | |||
outputChatBox ( "Your skin ID is: " .. getPlayerSkin ( getLocalPlayer() ) ) | |||
end | end | ||
addCommandHandler ( "skin", checkSkin ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Player functions}} | {{Player functions}} |
Latest revision as of 16:18, 13 February 2015
![]() |
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. |
Please use getElementModel instead. |
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 [-]
ServerExample 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 [-]
ClientThis 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
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerCount
- getPlayerIdleTime
- getPlayerIP
- getPlayerScriptDebugLevel
- getPlayerVersion
- getRandomPlayer
- isPlayerMuted
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerMuted
- setPlayerScriptDebugLevel
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerScreenShot
Shared
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState