[Tool/Web/Other] Api to retrieve server info - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Tools and Files (
https://sampforum.blast.hk/forumdisplay.php?fid=82)
+---- Thread: [Tool/Web/Other] Api to retrieve server info (
/showthread.php?tid=410084)
API to retrieve server info -
dmbekker - 24.01.2013
Hi there,
Because of boredness I created a simple XML api to retrieve some info about your server (rules, info and player list). The api is located at
http://sampapi.d4v1d.nl/ and takes 2 arguments: Format (currently only XML is supported, soon json will be) and IP:PORT, so, for example:
http://sampapi.d4v1d.nl/xml/85.17.169.205:7787 would give the following output:
Код:
<server>
<errors/>
<info>
<value name="password">
<![CDATA[ 0 ]]>
</value>
<value name="players">
<![CDATA[ 13 ]]>
</value>
<value name="maxplayers">
<![CDATA[ 30 ]]>
</value>
<value name="hostname">
<![CDATA[ [0.3e](`._.[Andromada Sumo]._.) ]]>
</value>
<value name="gamemode">
<![CDATA[ [A]Sumo V2.5.4 ]]>
</value>
<value name="mapname">
<![CDATA[ Find it ]]>
</value>
</info>
<rules>
<value name="gravity">
<![CDATA[ 0.008 ]]>
</value>
<value name="mapname">
<![CDATA[ Find it ]]>
</value>
<value name="version">
<![CDATA[ 0.3e-R2 ]]>
</value>
<value name="weather">
<![CDATA[ 10 ]]>
</value>
<value name="weburl">
<![CDATA[ andromada.net ]]>
</value>
<value name="worldtime">
<![CDATA[ 13:00 ]]>
</value>
</rules>
<players>
<value playerid="0" score="132" ping="26">d4v1d</value>
<!-- More players. -->
</players>
</server>
If something goes wrong it always tries to give a nice and fancy error message. Current errors (that are catched and give a nice error message) are:
If you find any other errors or something's not working reply in this topic and let me know what you think (even if there are no errors
![Cheesy](images/smilies/biggrin.png)
)