Jump to content
  • 0

Display a servers online player count (Custom Debug Monitor)


RisingDead

Question

Hi there,

 

I was just wondering if anyone can help with how to display/fetch the servers player count?

 

I am fairly certain that to fetch this value I need to use:

(count playableUnits)

However it isnt working in my debug monitor.

 

The code for this is as follows:

	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>Example Server Name</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#D60000'>www.websiteExample.com</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Survived %2 Days</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='0.95 'font='Bitstream' align='right'>%3</t><br/> <-----HERE
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %10 Minutes</t><br/>",

	dayz_playerName,(dayz_Survived),(count playableUnits),_killsH,_killsB,_kills,round _humanity,r_player_blood,(round diag_fps),(round(180-(serverTime) / 60))
	];

 

This is then the executing code in my init.sqf located at around line 60 (not at the end of the file).

if (!isDedicated) then {
[] execVM "scripts\custom_monitor.sqf";

Here (count playableUnits) should be displaying server players. If I am correct this should be being fetched from my playerstats.sqf? However for some reason the vaule is ALWAYS 1 for any normal player.

 

For admins however it works perfectly and changes as it should.

 

Can anyone explain what Is wrong here?

 

Everything else in the monitor works perfectly 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

It turns out Anti Hack is most likely stopping this.

 

So therefore this topic can be closed/ removed.

Yeah the Antihack "disabled" the playableUnits command but you can still use other commands to get the player number.

Like playersNumber:

_onlinePlayer = playersNumber west;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...