RoomService v2.3.1
Loading...
Searching...
No Matches
RoomService.GetPlayerCount Class Reference

Lua function to get the number of players in the current lobby.

Member Function Documentation

◆ Implementation()

int RoomService.GetPlayerCount.Implementation ( )
inlineprivate

Usage:

Lua function to get the number of players in the current lobby.
Definition RoomServiceLuaFunctions.cs:633
Definition MyPluginInfo.cs:2
Returns
The number of players in the current lobby, or -1 if unavailable.
Return values
int

Source Code

650 {
651 if (!RoomServiceUtils.IsOnlineHost())
652 {
653 return -1;
654 }
655
656 return ZeepkistNetwork.Players?.Count ?? -1;
657 }