You can now show the status of your FiveM server in your game launchers thanks to this PHP script devised by Danny, Villy, Stephen and XPreciousGaming (mostly XPG).
This is a PHP file that you should create, configure then upload to a webserver (any web server that has PHP). Once you have created, edited and uploaded it you can then point to this PHP file using the QUERY STRING object inside Game Launcher Creator to show a real-time Online/Offline status of your FiveM server(s).
Step 1 – Copy the PHP Code
Firstly, you need to copy the following PHP code to notepad on your computer…
<?php // Brought To You By Danny, Stephen, XPreciousGaming And Villy /
// Need Any Help Read ReadMe.txt Or Contact XPreciousGaming Main#8040 On Discord Or Join https://discord.gg/449uWzW /
/*———————–[ SETTINGS ]——————————*/
$server_settings[‘ip’] = “your ip here”; // localhost for local servers / IP or domain name for VDS/VPS
$server_settings[‘port’] = “your port here”; // basically 30120
$url1=$_SERVER[‘REQUEST_URI’]; // Dont Change Any Lines Below
header(“Refresh: 5; URL=$url1”);
$content = json_decode(@file_get_contents(“http://”.$server_settings[‘ip’].”:”.$server_settings[‘port’].”/info.json”), true);
$img_d64 = $content[‘icon’];
$SRV_STATUS = “Online”;
$SRV_STATUS = “Offline”;
print ” $SRV_STATUS”;
Once you have copied, then pasted this into a new notepad file, we will need to modify some of it.
Step 2 – Server Modification
Now you need to modify some of the settings to match your server, to get the correct server information.
The first line to edit is under [ SETTINGS ] and it is:
$server_settings[‘ip’] = “your IP here” – where it says your IP here, replace this inside the speech marks, with your server IP (not port, just IP address)
$server_settings[‘port’] = “your port here” – pop in your server port here, typically 30120
Now this is complete, you can save this file. When the Save As dialog pops up, select All Files (*.*) and type in yourfilename.php
Once you have saved your file, upload it to your web server, it must support PHP (most do, Windows ones don’t, by default).
Once you have uploaded it, write down the URL, typically something like (https://mysite.com/server-status.php)
Step 3 – Integrating into your FiveM Game Launcher
Now open up Game Launcher Creator, insert a Query String, head over to the properties of that string and put in your URL for the post-url like so
Insert the full URL in the POST url box, to test this, try inserting this URL into your web browser, it should display whether your server is online/offline.
For pre-POST text, you can write whatever you like. Typically you would write something like “Our FiveM Server is” and when it is online, it will display like:
Our FiveM Server is Online
You can also change the font settings from this dialog too. You can move and position the query string in the live launcher editor for your game launcher.