I wish to print to console the number of players on the server every x seconds, right now this prints 0, but when I join, it’s still 0. Have I forgotten something or is there a better way/native
using System;
using System.IO;
using System.Threading.Tasks;
using CitizenFX.Core;
using static CitizenFX.Core.Native.API;
namespace ServerDOJ
{
public class DOJScriptServer : BaseScript
{
int playerCount = GetNumPlayerIndices();
public DOJScriptServer()
{
Tick += OnTick;
}
private async Task OnTick()
{
Console.WriteLine(playerCount);
await Delay(10000);
}
}
}