Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 'deposit_js':
- if(!$user) exit(json_encode(array('success'=>false, 'error'=>'You must login to access the deposit.')));
- if($_COOKIE['tid']) {
- exit(json_encode(array('success'=>false, 'error'=>'You isset active tradeoffer.')));
- }
- $sql = $db->query('SELECT `id`,`name` FROM `bots` ORDER BY rand() LIMIT 1');
- $row = $sql->fetch();
- $bot = $row['id'];
- $partner = extract_partner($_GET['tradeurl']);
- $token = extract_token($_GET['tradeurl']);
- setcookie('tradeurl', $_GET['tradeurl'], time() + 3600 * 24 * 7, '/');
- $checksum = intval($_GET['checksum']);
- $prices = file_get_contents('prices.txt');
- $prices = json_decode($prices, true);
- $out = curl('http://'.$ip.':'.(3000+$bot).'/sendTrade/?assetids='.$_GET['assetids'].'&partner='.$partner.'&token='.$token.'&checksum='.$_GET['checksum'].'&steamid='.$user['steamid']);
- $out = json_decode($out, true);
- $out['bot'] = $row['name'];
- if($out['success'] == true) {
- //
- //incrementa o valor do item no txt em mais 20%
- //
- //No código abaixo não estou incrementando um item, apenas alterando o preço prices.txt(prices.json)
- $prices['response']['items'][$value['market_hash_name']]['value'] =
- $prices['response']['items'][$value['market_hash_name']]['value'] +
- ($prices['response']['items'][$value['market_hash_name']]['value'] * 0.20);
- file_put_contents('prices.txt', json_encode($json_data));
- //Final da linha de código
- $s = 0;
- foreach ($out['items'] as $key => $value) {
- $db->exec('INSERT INTO `items` SET `trade` = '.$db->quote($out['tid']).', `market_hash_name` = '.$db->quote($value['market_hash_name']).', `img` = '.$db->quote($value['icon_url']).', `botid` = '.$db->quote($bot).', `time` = '.$db->quote(time()));
- //NESSA LINHA ELE TRANSFORMA O DINHEIRO EM COINS
- $s += $prices['response']['items'][$value['market_hash_name']]['value']*10;
- }
- $db->exec('INSERT INTO `trades` SET `id` = '.$db->quote($out['tid']).', `bot_id` = '.$db->quote($bot).', `code` = '.$db->quote($out['code']).', `status` = 0, `user` = '.$db->quote($user['steamid']).', `summa` = '.$db->quote($s).', `time` = '.$db->quote(time()));
- $out['amount'] = $s;
- setcookie('tid', $out['tid'], time() + 3600 * 24 * 7, '/');
- }
- exit(json_encode($out));
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement