GetRandomPlayer: Difference between revisions
Jump to navigation
Jump to search
Black Dragon (talk | contribs) mNo edit summary |
m (Minor changes) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Server function}} | ||
This function returns a random [[player]] | This function returns a random [[player]]. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">player getRandomPlayer ( )</syntaxhighlight> | <syntaxhighlight lang="lua"> | ||
player getRandomPlayer ( ) | |||
</syntaxhighlight> | |||
=== | ===Returns=== | ||
'' | Returns a random [[player]], ''false'' if the server is empty. | ||
==Example== | ==Example== | ||
This code outputs a random's player name. | This code outputs a random's player name. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
randomPlayer = getRandomPlayer ( ) | local randomPlayer = getRandomPlayer ( ) | ||
outputChatBox ( getClientName ( randomPlayer ).." is now the fugitive!" ) | outputChatBox ( getClientName ( randomPlayer ).." is now the fugitive!" ) | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 12:33, 13 August 2007
This function returns a random player.
Syntax
player getRandomPlayer ( )
Returns
Returns a random player, false if the server is empty.
Example
This code outputs a random's player name.
local randomPlayer = getRandomPlayer ( ) outputChatBox ( getClientName ( randomPlayer ).." is now the fugitive!" )
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