Querying SAMP Server form PHP.
#1

Is there any way I can get the server's info from PHP.

I have tried some old one's and all of them aren't working...
If there is any new one... Please reply with a link.. Will be greatly appreciated.
Reply
#2

The easiest way is to get data from SACNR monitor via their API.
Reply
#3

Quote:
Originally Posted by Sergei
Посмотреть сообщение
The easiest way is to get data from SACNR monitor via their API.
I never knew they have an API..
Thanks alot mate.

Gonna look for it.

EDIT:
Umm... Their site seems to be down for me.. ?
If you can get me a link, It'd be great
Reply
#4

Or you can look here: https://sampwiki.blast.hk/wiki/Query_Mechanism
Cuts out the middle man.
Reply
#5

Honestly;
https://sampforum.blast.hk/showthread.php?tid=104299
works fine.

I don't get the issue. Additionally as already mentioned many websites offer monitor API's.
Reply
#6

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Honestly;
https://sampforum.blast.hk/showthread.php?tid=104299
works fine.

I don't get the issue. Additionally as already mentioned many websites offer monitor API's.
That one keeps saying offline.
Reply
#7

As other's have said, use Westie's SampQueryAPI for instant, up-to-date information.

Quote:
Originally Posted by Sergei
Посмотреть сообщение
The easiest way is to get data from SACNR monitor via their API.
I don't know why you would use an external service that caches results when you can quite easily query your server by yourself.
Reply
#8

Quote:
Originally Posted by ev0lution
Посмотреть сообщение
As other's have said, use Westie's SampQueryAPI for instant, up-to-date information.

I don't know why you would use an external service that caches results when you can quite easily query your server by yourself.
Well, SACNR Monitor API tells you a few extra things:

- The server's hosted tab status
- Average players + server rank
- Previous player count readings (up to 2 weeks), suitable for using in a graph

The API will also work if your server is down temporarily (e.g. for a server restart or outage). Although SACNR Monitor has its outages from time to time as well.

If you just want to get the player count and don't care about any of this, then just use Westie's query class.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)