GetRandomPlayer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Minor changes)
mNo edit summary
 
(7 intermediate revisions by 7 users not shown)
Line 7: Line 7:
player getRandomPlayer ( )
player getRandomPlayer ( )
</syntaxhighlight>
</syntaxhighlight>
 
{{OOP||[[Player]].getRandom}}
===Returns===
===Returns===
Returns a random [[player]], ''false'' if the server is empty.
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 player's name.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local randomPlayer = getRandomPlayer ( )
local randomPlayer = getRandomPlayer ( )
outputChatBox ( getClientName ( randomPlayer ).." is now the fugitive!" )
outputChatBox ( getPlayerName ( randomPlayer ).." is now the fugitive!" )
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}
[[pl:getRandomPlayer]]

Latest revision as of 10:27, 16 November 2017