Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!isset($_POST["id"])){
- return;
- }
- require_once("Rcon.php");
- class generateKey{
- private $tamanho;
- public function __construct($tamanho = 15){
- $this->tamanho = $tamanho;
- }
- public function gerar(){
- $key = "";
- $all = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
- for($i=0 ; $i < $this->tamanho; $i++){
- $key .= $all[mt_rand(0, 61)];
- }
- return $key;
- }
- }
- $html = false;
- $keyfix = "";
- $decoded = json_decode(file_get_contents("ids.json"), true);
- if(isset($decoded[$_POST["id"]])){
- $key = new generateKey(20);
- $keyfix = $key->gerar();
- $class = new Rcon("fulledits.auroramystic.com", 18002, "54UEUGf4HI", 30);
- $class->connect();
- if($decoded[$_POST["id"]]["Produto"] == "cash"){
- $class->sendCommand("chave criar ".$keyfix);
- $class->sendCommand("chave editar ".$keyfix." addcash {PLAYER} ".$decoded["Quantidade"]);
- }
- unset($decoded[$_POST["id"]]);
- file_put_contents("ids.json", json_encode($decoded));
- $html = true;
- }
- if(!$html){
- return;
- }else{
- echo "O id não existe fih";
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>KEY</title>
- </head>
- <body>
- <center><h1>SUA KEY</h1></center>
- <center><h1><?php echo "<font color=\"purple\">".$keyfix?></h1><center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement