[GRATIS]Minecraft Server Checker

Gestart doorBjarnootjuh17 reacties75 weergaven

18 berichten · pagina 1 van 2

Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi

Ik gooi een script de wereld in om te checken via php of jou minecraft server online is!

Hier is de code:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
 * @author         Bjarn B.
 * @description   Checks your the Minecraft server status
 */

/* Enter your server name */[/COLOR]
[COLOR= #0000BB]$name[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<p>Server is</p>  [/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]/* Enter your host name */[/COLOR]
[COLOR= #0000BB]$host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]/* Enter your server port */[/COLOR]
[COLOR= #0000BB]$port[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]/* Disable errors */[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]


[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$socket[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/fsockopen"]fsockopen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$port[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$errno[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$errstr[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700])) {[/COLOR]

    [COLOR= #FF8000]/* If it is offline, show this */[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$name[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]<img src="/images/online.jpg" alt="online">[/COLOR][COLOR= #007700];[/COLOR]
    
    [URL="http://www.php.net/fclose"]fclose[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$socket[/COLOR][COLOR= #007700]);

}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

    [COLOR= #FF8000]/* If it is offline, show this */[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$name[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]<img src="/images/offline.jpg" alt="offline">[/COLOR][COLOR= #007700];

}[/COLOR]
?>
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Je kan ook simpel minecraft Query gebruiken, dan kan je veel meer ophalen:
- Online users
- Max online users
- Namen van online players
- Plugins
- Worlds
En veel meer smile

(Zie hier.)
0
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit script werkt toch ook gewoon voor andere game-servers als SA-MP, MTA e.d.?
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nielsjojo schreef:
Dit script werkt toch ook gewoon voor andere game-servers als SA-MP, MTA e.d.?
Als het goed is wel ja.
0
Berichten
1.871
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Getest werkt ook met SA-MP biggrin
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nielsjojo schreef:
Getest werkt ook met SA-MP biggrin
Das wel cool biggrin
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Onthoud wel dat de poort die je invult, dat hij daar naartoe een connectie probeert te leggen, en als je bijvoorbeeld poort 1234 neemt, en als host bijvoorbeeld One2xs, en liteserver heeft poort 1234 naar buiten (UDP dacht ik) niet open staan, dan krijg je de melding dat hij offline is, terwijl hij wel online is!
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Xjessex schreef:
Onthoud wel dat de poort die je invult, dat hij daar naartoe een connectie probeert te leggen, en als je bijvoorbeeld poort 1234 neemt, en als host bijvoorbeeld One2xs, en liteserver heeft poort 1234 naar buiten (UDP dacht ik) niet open staan, dan krijg je de melding dat hij offline is, terwijl hij wel online is!
Dat wel.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Dit is echt lelijk uitgelijnt
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Raaoul schreef:
Dit is echt lelijk uitgelijnt
Niet uitgelijnd

de iet wat beter uitgelijnde versie

<div id="status">
    [COLOR= #0000BB]<?php[/COLOR]
    [COLOR= #FF8000]// Give your server a name[/COLOR]
    [COLOR= #0000BB]$name[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<p>Server is</p>  [/COLOR][COLOR= #007700];[/COLOR]
    [COLOR= #FF8000]// The host/ip[/COLOR]
    [COLOR= #0000BB]$host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]play.castleminers.eu[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//Jou IP of Hostname
    // The port[/COLOR]
    [COLOR= #0000BB]$port[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]25623[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//Jou port

    // Disable error stuff[/COLOR]
    [URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #FF8000]// Here it checks if the server is ofline or online and output it with some text.[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$socket[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/fsockopen"]fsockopen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$port[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$errno[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$errstr[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700])) {[/COLOR]

        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$name[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]<img src="/images/online.jpg" alt="online>[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//Online plaatje/tekst[/COLOR]
        [URL="http://www.php.net/fclose"]fclose[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$socket[/COLOR][COLOR= #007700]);
        
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$name[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]<img src="/images/offline.jpg" alt="offline>[/COLOR][COLOR= #007700];

    }[/COLOR] [COLOR= #FF8000]//Offline plaatje/tekst[/COLOR]
    ?>
</div>
0
Berichten
3.074
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Misschien iets beter uitlijnen? En je kan ook jouw copyright toevoegen voor naamsbekendheid.

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/**
 * @author         Bjarn B.
 * @description   Checks your the Minecraft server status
 */

/* Enter your server name */[/COLOR]
[COLOR= #0000BB]$name[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<p>Server is</p>  [/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]/* Enter your host name */[/COLOR]
[COLOR= #0000BB]$host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]/* Enter your server port */[/COLOR]
[COLOR= #0000BB]$port[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #FF8000]/* Disable errors */[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]


[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$socket[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/fsockopen"]fsockopen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$port[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$errno[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$errstr[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700])) {[/COLOR]

    [COLOR= #FF8000]/* If it is offline, show this */[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$name[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]<img src="/images/online.jpg" alt="online">[/COLOR][COLOR= #007700];[/COLOR]
    
    [URL="http://www.php.net/fclose"]fclose[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$socket[/COLOR][COLOR= #007700]);

}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

    [COLOR= #FF8000]/* If it is offline, show this */[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$name[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]<img src="/images/offline.jpg" alt="offline">[/COLOR][COLOR= #007700];

}[/COLOR]
?>
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Die van Joey toegevoegd
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wel best goed, maar heb je het wel zelf helemaal gescript?
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sanderc schreef:
Wel best goed, maar heb je het wel zelf helemaal gescript?
Helemaal zelf. Alleen ff fsockopen geleerd.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Sanderc schreef:
Wel best goed, maar heb je het wel zelf helemaal gescript?
Dude, het is gewoon gebruik maken van 1 functie, je ziet die functie in een ander voorbeeld en je hebt je script..
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren