GetRandomPlayer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
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.
Line 15: Line 15:
<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|server}}
[[pl:getRandomPlayer]]

Latest revision as of 22:42, 6 September 2024