Vyorel Posted December 2, 2014 Share Posted December 2, 2014 Can be given a code to display servers stats on other sites? I am interested about it. Thanks Link to comment Share on other sites More sharing options...
0 AbbieGator Posted December 2, 2014 Share Posted December 2, 2014 Not entirely sure but it could be in the public API section of the downloads. Link to comment Share on other sites More sharing options...
0 StuartD Posted December 2, 2014 Share Posted December 2, 2014 On the main ETS2MP page click on Download, then select the PHP SDK. That will allow you to create things and display the current MP server statuses. STVTC Founder & Management / TruckNet Developer Link to comment Share on other sites More sharing options...
0 Vyorel Posted December 2, 2014 Author Share Posted December 2, 2014 Ok thanks! I have downloaded PHP SDK arhive and... The archive is either in unknown format or damaged Link to comment Share on other sites More sharing options...
0 Guest Posted December 2, 2014 Share Posted December 2, 2014 Vyorel: basicly what you can do is get the content of http://api.ets2mp.com/servers/somehow and dump that into a variable(I'm using curl for this below, but any other way is possible too) $curl_handle = curl_init();$url = "http://api.ets2mp.com/servers/";curl_setopt($curl_handle, CURLOPT_URL, $url);curl_setopt($curl_handle, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" );curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);$response = curl_exec($curl_handle); $jsonobj = json_decode($response); echo $jsonobj->0->{'players'}; //will get you the current player count. Link to comment Share on other sites More sharing options...
0 Vyorel Posted December 3, 2014 Author Share Posted December 3, 2014 Ok, thanks! Resolved!But, only this values exists? From here?http://api.ets2mp.com/servers/ Link to comment Share on other sites More sharing options...
0 Guest Posted December 3, 2014 Share Posted December 3, 2014 yes, you can just do var_dump($jsonobj); to see the complete structure. Link to comment Share on other sites More sharing options...
0 Vyorel Posted December 4, 2014 Author Share Posted December 4, 2014 Ok thanks! This is my page http://www.ets2-mp.ro/servers/index.php Link to comment Share on other sites More sharing options...
0 Web Developer _J-M Posted December 4, 2014 Web Developer Share Posted December 4, 2014 Ok, thanks! Resolved! But, only this values exists? From here? http://api.ets2mp.com/servers/ For now this is the only public section. I never saw any other part of the API. I know the API contain more stuff but never really took a look at it Link to comment Share on other sites More sharing options...
Question
Vyorel
Can be given a code to display servers stats on other sites?
I am interested about it.
Thanks
Link to comment
Share on other sites
8 answers to this question
Recommended Posts