Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. $Rcon = new MinecraftRcon;
  2.  
  3. $Rcon->Connect( MQ_SERVER_ADDR, MQ_SERVER_PORT, MQ_SERVER_PASS, MQ_TIMEOUT );
  4. $element[]='give $nick 130 1';
  5. $element[]='give $nick 1 64';
  6. $cmd = $element[array_rand($element,1)];
  7. $Rcon->Command("$cmd");
  8. $Data = $Rcon->Command( null );
  9.  
  10. if( $Data === false )
  11. {
  12. throw new MinecraftRconException( "" );
  13. }
  14. else if( StrLen( $Data ) == 0 )
  15. {
  16. throw new MinecraftRconException( "" );
  17. }
  18.  
  19. echo HTMLSpecialChars( $Data );
  20. }
  21. catch( MinecraftRconException $e )
  22. {
  23. echo $e->getMessage( );
  24. }
  25.  
  26. $Rcon->Disconnect( );
  27. }
  28. else{
  29. echo '<b><center>Kod niepoprawny</center></b>';
  30. }
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement