GetRandomPlayer: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Example) |
||
Line 15: | Line 15: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local randomPlayer = getRandomPlayer ( ) | local randomPlayer = getRandomPlayer ( ) | ||
outputChatBox ( | outputChatBox ( getPlayerName ( randomPlayer ).." is now the fugitive!" ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Player functions}} | {{Player functions}} |
Revision as of 12:14, 27 August 2009
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 player's name.
local randomPlayer = getRandomPlayer ( ) outputChatBox ( getPlayerName ( 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