Online player count (+REP) -
Amit1998 - 22.05.2016
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.
Re: Online player count (+REP) -
Luicy. - 22.05.2016
Use a loop,
PHP код:
new usersOnline = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
usersOnline++;
}
}
Re: Online player count (+REP) -
JasperM - 22.05.2016
Quote:
Originally Posted by Meller
Use a loop,
PHP код:
new usersOnline = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
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.
Re: Online player count (+REP) -
Amit1998 - 22.05.2016
Quote:
Originally Posted by Meller
Use a loop,
PHP код:
new usersOnline = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
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
Re: Online player count (+REP) -
Amit1998 - 22.05.2016
think I found smth, will let u guys know in a few.
Re: Online player count (+REP) -
JasperM - 22.05.2016
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.
Re: Online player count (+REP) -
Amit1998 - 22.05.2016
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?
Re: Online player count (+REP) -
Amit1998 - 22.05.2016
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)