Jump to content
  • 1

What is the PHP SDK on the download page?

SimulatorSam [UK]


10 answers to this question

Recommended Posts

  • 0

It's quite simple if you know what you're doing..


This might not be the best way of doing it but it works for me :')


 include('extra/TruckMPApi.php'); // Calls the MP API for use. $api = new TruckMPApi(); // Creates the API class.$servers = $api->GetServers(); // Gets the server information array. $eu_1_name = $servers[0]->shortname; // Gets the name of server 1. $eu_1_status = $servers[0]->online; // Gets the status of server 1. $eu_1_players = $servers[0]->players; // Gets the player count of server 1. if($eu_1_status){ // If the server is online  echo $eu_1_name ." - Online - ". $eu_1_players; // Show the short name and the player count.} else { // Otherwise.  echo "Server 1 Offline"; // say that it is offline.}


This is the basic part of it however the MP people have just styled the page to make it look more appealing. EG this is mine from the ST page.



Link to comment
Share on other sites

This topic is now closed to further replies.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.