Difference between revisions of "GetNumberOfPlayers"

From Nomad DB
(Created page with "Get the number of players in the current play session. == Syntax == <syntaxhighlight lang="lua"> GetNumberOfPlayers() </syntaxhighlight> * '''Returns''' (number): Player Coun...")
 
(No difference)

Latest revision as of 19:25, 14 April 2020

Get the number of players in the current play session.

Syntax

GetNumberOfPlayers()
  • Returns (number): Player Count

Example

local playerCount = GetNumberOfPlayers()
for i = 0, playerCount - 1 do
    local playerEntityId = GetEntityIdFromPlayerIndex(i)
    -- do stuff
end

Related Pages