Online player count (+REP)
#1

Hey guys,
been trying to make some online statistics for my server(starting off with an online player count - "There are X players online!")
Anywho, the PHP classes I was using seems to be outdated as they work only on a localhost and not on an actual website host, regardless of the PHP versions(I was using Woet's). If someone could please help me out and give me a new method on how to record these, I'd be thankful.

+REPing the helper.
Reply
#2

Use a loop,
PHP код:
new usersOnline 0;
for(new 
0MAX_PLAYERSi++)
{
    if(
IsPlayerConnected(i))
    {
         
usersOnline++;
    }

Reply
#3

Quote:
Originally Posted by Meller
Посмотреть сообщение
Use a loop,
PHP код:
new usersOnline 0;
for(new 
0MAX_PLAYERSi++)
{
    if(
IsPlayerConnected(i))
    {
         
usersOnline++;
    }

Obviously this is about PHP, not PAWN. I made something similar some time ago, lets see if I can find it.
Reply
#4

Quote:
Originally Posted by Meller
Посмотреть сообщение
Use a loop,
PHP код:
new usersOnline 0;
for(new 
0MAX_PLAYERSi++)
{
    if(
IsPlayerConnected(i))
    {
         
usersOnline++;
    }

was talking about a PHP version for a website
Quote:
Originally Posted by JasperM
Посмотреть сообщение
Obviously this is about PHP, not PAWN. I made something similar some time ago, lets see if I can find it.
Thanks a lot, because every single version I tried using, regardless of the author, doesn't work elsewhere rather than on the localhost(my PC), when I upload it to my website it says that the server is offline when it's up O_O
Reply
#5

think I found smth, will let u guys know in a few.
Reply
#6

Quote:
Originally Posted by Amit1998
Посмотреть сообщение
was talking about a PHP version for a website


Thanks a lot, because every single version I tried using, regardless of the author, doesn't work elsewhere rather than on the localhost(my PC), when I upload it to my website it says that the server is offline when it's up O_O
Seems like I am getting that same problem with my old script aswell. I remember that I once had a problem with my host blocking certain outgoing connections, after which I requested him to open some ports and it resolved the problem. Therefore, if you run your website on a VPS, I don't think you would expire any issues, but I don't think that's what you're doing + I can't test it out for you.
Reply
#7

Quote:
Originally Posted by JasperM
Посмотреть сообщение
Seems like I am getting that same problem with my old script aswell. I remember that I once had a problem with my host blocking certain outgoing connections, after which I requested him to open some ports and it resolved the problem. Therefore, if you run your website on a VPS, I don't think you would expire any issues, but I don't think that's what you're doing + I can't test it out for you.
I have tried using 3 different hosts(000webhost, some foreign host and doteasy). Do you know a good hosting provider?
Reply
#8

Anyone knows what's bugging my script on my web host? It works fine on a localhost
(The bug is that the player count is not shown)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)