Dalexhd

Untitled

Sep 2nd, 2017
2,529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.30 KB | None | 0 0
  1. $json_get_csgo_stats = 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key='.$config["steam_api_apikey"].'&steamid='.$row["steamid"].'&include_appinfo=1&&format=json';
  2.             $json_get_bans = 'http://api.steampowered.com/ISteamUser/GetPlayerBans/v1/?key='.$config["steam_api_apikey"].'&steamids='.$row["steamid"].'';
  3.             $json_kdr = 'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key='.$config["steam_api_apikey"].'&steamid='.$row["steamid"].'';
  4.             $json_steam_stat = ' http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$config["steam_api_apikey"].'&steamids='.$row["steamid"].'';
  5.  
  6.             $json_cs_stats = file_get_contents($json_get_csgo_stats);
  7.             $data_cs_stats = json_decode($json_cs_stats);
  8.             $json_steam_ban = file_get_contents($json_get_bans);
  9.             $data_steam_ban = json_decode($json_steam_ban);
  10.             $json_csgo_kdr = file_get_contents($json_kdr);
  11.             $data_csgo_kdr = json_decode($json_csgo_kdr);
  12.  
  13.             $json_steam_status = file_get_contents($json_steam_stat);
  14.             $data_steam_status = json_decode($json_steam_status);
  15.  
  16.  
  17.             foreach ($data_steam_status->response->players as $status) {
  18.  
  19.  
  20.                 $steam_status = "";
  21.                 $steam_status .= $status->personastate;
  22.  
  23.                
  24.  
  25.  
  26.             }
  27.  
  28.  
  29.             if ($steam_status = 0) {
  30.                 $steam_official_status = "";
  31.                 $steam_official_status = "Desconectado";
  32.             }elseif ($steam_status = 1) {
  33.                 $steam_official_status = "";
  34.                 $steam_official_status = "En linea";
  35.             }elseif ($steam_status = 2) {
  36.                 $steam_official_status = "";
  37.                 $steam_official_status = "Ocupado";
  38.                 exit();
  39.             }elseif ($steam_status = 3) {
  40.                 $steam_official_status = "";
  41.                 $steam_official_status = "Ausente";
  42.             }elseif ($steam_status = 4) {
  43.                 $steam_official_status = "";
  44.                 $steam_official_status = "Deseando Intercambiar";
  45.             }elseif ($steam_status = 6) {
  46.                 $steam_official_status = "";
  47.                 $steam_official_status = "Deseando Jugar";
  48.             }
  49.  
  50.  
  51. echo $steam_official_status;
  52.  
  53.             foreach ($data_cs_stats->response->games as $games) {
  54.  
  55.  
  56.                 if ($games->appid == "730"){
  57.                     $conuter_player = "";
  58.                     $total_time_played = "";
  59.                     $conuter_player .=  "TRUE";
  60.                     $total_time_played .= $games->playtime_forever;
  61.  
  62.                 }
  63.  
  64.  
  65.             }
  66.  
  67.  
  68.  
  69.             $t = $total_time_played;
  70.             $h = floor($t/60) ? floor($t/60) .' horas' : '';
  71.             $m = $t%60 ? $t%60 .' minutos' : '';
  72.             $minutes = $h && $m ? $h.' y '.$m : $h.$m;
  73.  
  74.  
  75.             foreach ($data_csgo_kdr->playerstats->stats as $kdr) {
  76.  
  77.  
  78.                 if ($kdr->name == "total_kills"){
  79.                     $total_kills = "";
  80.  
  81.                     $total_kills .=  $kdr->value;
  82.  
  83.                 }
  84.  
  85.                 if ($kdr->name == "total_deaths"){
  86.                     $total_deaths = "";
  87.  
  88.                     $total_deaths .=  $kdr->value;
  89.  
  90.                 }
  91.             }
  92.             $kdr_full = $total_deaths/$total_kills;
  93.             $kdr = substr($kdr_full, 0, -12);
  94.             foreach ($data_steam_ban->players as $bans) {
  95.  
  96.  
  97.                 if ($bans->VACBanned === false){
  98.                     $result_steam_ban = "";
  99.                     $result_steam_ban .= "0";
  100.                 }elseif ($bans->VACBanned === true){
  101.                     $result_steam_ban = "";
  102.                     $result_steam_ban .= "1";
  103.                 }
  104.  
  105.  
  106.             }
  107.             echo $result_steam_ban;
  108.             $ts3_VirtualServer->execute("clientedit", array(
  109.                 "clid" => $value['clid'],
  110.                 "client_description" => "| Estado de Steam  $steam_official_status | Estado VAC $result_steam_ban | Horas jugadas al CS:GO $minutes | CS:GO KDR  $kdr |",
  111.                 ));
  112.  
  113.         }
Advertisement
Add Comment
Please, Sign In to add comment