Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $json_get_csgo_stats = 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key='.$config["steam_api_apikey"].'&steamid='.$row["steamid"].'&include_appinfo=1&&format=json';
- $json_get_bans = 'http://api.steampowered.com/ISteamUser/GetPlayerBans/v1/?key='.$config["steam_api_apikey"].'&steamids='.$row["steamid"].'';
- $json_kdr = 'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key='.$config["steam_api_apikey"].'&steamid='.$row["steamid"].'';
- $json_steam_stat = ' http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$config["steam_api_apikey"].'&steamids='.$row["steamid"].'';
- $json_cs_stats = file_get_contents($json_get_csgo_stats);
- $data_cs_stats = json_decode($json_cs_stats);
- $json_steam_ban = file_get_contents($json_get_bans);
- $data_steam_ban = json_decode($json_steam_ban);
- $json_csgo_kdr = file_get_contents($json_kdr);
- $data_csgo_kdr = json_decode($json_csgo_kdr);
- $json_steam_status = file_get_contents($json_steam_stat);
- $data_steam_status = json_decode($json_steam_status);
- foreach ($data_steam_status->response->players as $status) {
- $steam_status = "";
- $steam_status .= $status->personastate;
- }
- if ($steam_status = 0) {
- $steam_official_status = "";
- $steam_official_status = "Desconectado";
- }elseif ($steam_status = 1) {
- $steam_official_status = "";
- $steam_official_status = "En linea";
- }elseif ($steam_status = 2) {
- $steam_official_status = "";
- $steam_official_status = "Ocupado";
- exit();
- }elseif ($steam_status = 3) {
- $steam_official_status = "";
- $steam_official_status = "Ausente";
- }elseif ($steam_status = 4) {
- $steam_official_status = "";
- $steam_official_status = "Deseando Intercambiar";
- }elseif ($steam_status = 6) {
- $steam_official_status = "";
- $steam_official_status = "Deseando Jugar";
- }
- echo $steam_official_status;
- foreach ($data_cs_stats->response->games as $games) {
- if ($games->appid == "730"){
- $conuter_player = "";
- $total_time_played = "";
- $conuter_player .= "TRUE";
- $total_time_played .= $games->playtime_forever;
- }
- }
- $t = $total_time_played;
- $h = floor($t/60) ? floor($t/60) .' horas' : '';
- $m = $t%60 ? $t%60 .' minutos' : '';
- $minutes = $h && $m ? $h.' y '.$m : $h.$m;
- foreach ($data_csgo_kdr->playerstats->stats as $kdr) {
- if ($kdr->name == "total_kills"){
- $total_kills = "";
- $total_kills .= $kdr->value;
- }
- if ($kdr->name == "total_deaths"){
- $total_deaths = "";
- $total_deaths .= $kdr->value;
- }
- }
- $kdr_full = $total_deaths/$total_kills;
- $kdr = substr($kdr_full, 0, -12);
- foreach ($data_steam_ban->players as $bans) {
- if ($bans->VACBanned === false){
- $result_steam_ban = "";
- $result_steam_ban .= "0";
- }elseif ($bans->VACBanned === true){
- $result_steam_ban = "";
- $result_steam_ban .= "1";
- }
- }
- echo $result_steam_ban;
- $ts3_VirtualServer->execute("clientedit", array(
- "clid" => $value['clid'],
- "client_description" => "| Estado de Steam $steam_official_status | Estado VAC $result_steam_ban | Horas jugadas al CS:GO $minutes | CS:GO KDR $kdr |",
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment