GetPlayerFromNick: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 29: | Line 29: | ||
==See Also== | ==See Also== | ||
{{ | {{Player functions}} |
Revision as of 20:01, 20 May 2006
This function returns a player element for the player with the name passed to the function.
Syntax
player getPlayerFromNick ( string playerName )
Required Arguments
- playerName: A string containing the name of the player you want to reference
Returns
Returns a player element for the player with the nickname provided. If there is no player with that name, false is returned.
Example
This example finds a player called Someguy, and if he is found, he is killed and a message is displayed.
-- Find the player with the nickname 'Someguy' myPlayer = getPlayerFromNick ( "Someguy" ) -- If a player was returned (false is returned if the player isn't found) if ( myPlayer ~= false ) -- If the player was killed succesfully then if ( killPlayer ( myPlayer ) ) then -- Say so in the chat outputChatBox ( "Someguy was found, and eliminated" ) end end
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState