得到奇怪的杀戮(TF2 +蒸汽API

时间:2016-05-14 18:21:35

标签: steam steam-web-api

我一直试图在tf2中获得某个奇怪项目的杀戮,但我的结果仍然是空白。有关如何执行此操作的任何线索?

这是我目前得到的:

$userBackpack = json_decode(file_get_contents($backpackURL), true);
<?php 
foreach($userBackpack['result']['items'] as $ind=>$item) 
{
  if($item['defindex'] == 999)
    { 
      $totalkills = $userBackpack['result']['items'][0]['attributes'][0]['defindex'];
      if($item['attributes'][0]['defindex'] == "214")
        {   
          echo $item['attributes'][0]['value'];
        }
    }
else { }
}

?>

214是API中的奇怪杀戮的定义索引。

"attributes": [
                    {
                        "defindex": 189,
                        "value": 1093664768,
                        "float_value": 11
                    },
                    {
                        "defindex": 211,
                        "value": 1424797755,
                        "float_value": 8132551507968
                    },
                    {
                        "defindex": 214,
Looking for S kills  -->`"value": 1000,
                        "float_value": 1.4012984643248171e-042
                    }
              ]

1 个答案:

答案 0 :(得分:0)

结束,想出了一个问题。

对于那些需要帮助的人 使用阀门JSON值 http://steamcommunity.com/id/ {customurl} /库存/ JSON /二分之七百三十 然后foreach rgDescriptions得到&#34;类型&#34;这是杀人。