Skip to main content

Players

All the pool functions for players.

PlayersArray type

A type that is returned from multiple of the functions on the page.

NameTypeDescription
pedintegerThe ped handle.
idintegerThe player id.

GetPlayerPeds

Function

local Pools = WXSCore.Pools
Pools.Players:GetPlayerPeds()

Returns

NameTypeDescription
pedsPlayersArrayA table of all the player peds.

Example

local Pools = WXSCore.Pools
local players = Pools.Players:GetPlayerPeds()

GetInArea

Function

local Pools = WXSCore.Pools
Pools.Players:GetInArea(coords, radius)

Parameters

NameTypeDescription
coordsvector3The coordinates of the area.
radiusfloatThe radius of the area.

Returns

NameTypeDescription
pedsPlayersArrayA table of all the player peds in the area.

Example

local Pools = WXSCore.Pools
local players = Pools.Players:GetInArea(vector3(0.0, 0.0, 0.0), 100.0)

GetClosestPlayer

Function

local Pools = WXSCore.Pools
Pools.Players:GetClosestPlayer(coords)

Parameters

NameTypeDescription
coordsvector3The coordinates of the area.

Returns

NameTypeDescription
playerintegerThe player handle of the closest player.
distancefloatThe distance to the closest player.

Example

local Pools = WXSCore.Pools
local player, distance = Pools.Players:GetClosestPlayer(vector3(0.0, 0.0, 0.0))