Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $api = new SimPay(API_KEY, API_SECRET, API_VERSION);
- $api->getStatus(array(
- 'service_id' => '1273', // identyfikator usl�ugi premium sms
- 'number' => '91055', // numer na ktory wyslano sms
- 'code' => $_POST['code'], // kod wprowadzony przez klienta
- ));
- if($api->check()) {
- define( 'MQ_SERVER_ADDR', '176.31.18.53' ) ; // adres IP Twojego Serwera
- define( 'MQ_SERVER_PORT', 1340 ); // Port rcon który ustawiłeś/aś w pliku serwer.properties
- define( 'MQ_SERVER_PASS', 'gomiencraft.pl' ); // hasło które ustawiłeś/aś w pliku serwer.properties
- define( 'MQ_TIMEOUT', 2 );
- require __DIR__ . 'MinecraftRcon.class.php'; // tutaj ścieżka do wcześniej zdefioniowanego //pliku dla połączenia się z rcon
- $nick=$_POST['gracz'];
- echo "<pre>";
- try
- {
- $Rcon = new MinecraftRcon;
- $Rcon->Connect( MQ_SERVER_ADDR, MQ_SERVER_PORT, MQ_SERVER_PASS, MQ_TIMEOUT );
- $Data = $Rcon->Command( "bc nick kupil wlasnie range!" ); // Przykładowa komenda która da użytkownikowi rangę VIP na 7 dni .
- if( $Data === false )
- {
- throw new MinecraftRconException( "Failed to get command result." );
- }
- else if( StrLen( $Data ) == 0 )
- {
- throw new MinecraftRconException( "Got command result, but it's empty." );
- }
- echo HTMLSpecialChars( $Data );
- }
- catch( MinecraftRconException $e )
- {
- echo $e->getMessage( );
- }
- $Rcon->Disconnect( );
- } else if($api->error()) {
- // Widok tylko w wersji deweloperskiej - do wylaczenia po zakonczeniu testow
- echo 'Wystapil blad:<br/>';
- pre($api->showError());
- } else {
- print_r($api->showStatus());
- }
- }
- catch(Exception $e) {
- echo 'Error: ' .$e->getMessage();
- }
- ?>
- <form method="post" >
- <input type="hidden" name="send" value="" />
- <input name="gracz" placeholder="Nick gracza" type="text" />
- <input type="hidden" name="send" value="" />
- <input name="code" placeholder="Kod z sms" type="text" />
- <button class="button" type="submit">Sprawdz kod</button>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment