Jump to content
  • 1
Sign in to follow this  
SimulatorSam [UK]

What is the PHP SDK on the download page?

Question

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.

 

22111122.png

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...