GetRandomPlayer: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


==Syntax==
==Syntax==
[[player]] [[GetRandomPlayer]] ()
<syntaxhighlight lang="lua">player GetRandomPlayer ()</syntaxhighlight>


===Required Arguments===
===Required Arguments===
Line 10: Line 10:


==Example==
==Example==
player = [[GetRandomPlayer]] ( )
<syntaxhighlight lang="lua">player = GetRandomPlayer ( )
[[serverChat]] ( [[GetPlayerName]] ( player ) , " is now the fugitive!" )
serverChat ( GetPlayerName ( player ) , " is now the fugitive!" )</syntaxhighlight>

Revision as of 03:28, 20 May 2006

Description

This function returns a random player object. It is useful for assigning objectives to random players in a Manhunt mode, for example.

Syntax

player GetRandomPlayer ()

Required Arguments

This function has no arguments.

Example

player = GetRandomPlayer ( )
serverChat ( GetPlayerName ( player ) , " is now the fugitive!" )