Jump to content

How To Show Current Players Online (On Webpage)


Jacen

Recommended Posts

So I'm just looking for a simple script that prints the amount of players on a server. If theres 40 in-game it will print 40 on the webpage. Pretty sure this could be done as Ive seen other servers have it.

Also hopefully it would be possible to grab players from 4 servers, merge the number and print the result?

Link to comment
Share on other sites

Here is an example I just made using PHP:

https://github.com/EpochModTeam/Epoch/blob/master/Tools/PHP/GetOnlinePlayers.php

Redis is basically programming language agnostic so, if you are more familiar with another language there is likely to be support for it.

http://redis.io/clients

 

So my website is hosted through a Linux server, do I just install the Redis packages, then this script will work. Sorry I do a small amount of backend PHP work but I'm no professional. :D

Link to comment
Share on other sites

So my website is hosted through a Linux server, do I just install the Redis packages, then this script will work. Sorry I do a small amount of backend PHP work but I'm no professional. :D

 

No, Redis is for A3 and you've posted in the A2 section, that means Awols code won't work because A2 uses Sql, try my link instead.

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...