GetRandomPlayer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Minor changes)
mNo edit summary
Line 12: Line 12:


==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 ( )

Revision as of 13:30, 19 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 player's name.

local randomPlayer = getRandomPlayer ( )
outputChatBox ( getClientName ( randomPlayer ).." is now the fugitive!" )

See Also