GetRandomPlayer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (fix oop syntax)
m (Added link to perfect, excellent, beautiful, gorgeous Polish translation.)
Line 20: Line 20:
==See Also==
==See Also==
{{Player functions}}
{{Player functions}}
[[pl:getRandomPlayer]]

Revision as of 11:06, 21 July 2016

This function returns a random player.

Syntax

player getRandomPlayer ( )

OOP Syntax Help! I don't understand this!

Method: Player.getRandom(...)


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