GetPlayerIdFromPlayerIndex
From Nomad DB
Retrieves the Player ID of the player with the specified index.
Syntax
GetPlayerIdFromPlayerIndex(playerIndex)
- playerIndex (number): Player index of the target player
- Returns (number): Player ID
Example
The example below checks whether the Entity ID of the local player is valid or not.
local playerCount = GetNumberOfPlayers()
for i = 0, playerCount - 1 do
local playerId = GetPlayerIdFromPlayerIndex(i)
local playerNameDebug = GetPlayerNameDebug(playerId)
if playerNameDebug == "2XTheTap" then
-- do stuff
end
end