0

I've been trying to get the kills of a certain strange item in tf2, but my results keep returning blank. Any clue on how this is performed?

Heres what I've currently got:

$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 being the defindex that strange kills fall under in the 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
                    }
              ]
Laurel
  • 5,965
  • 14
  • 31
  • 57
Morgan
  • 52
  • 7

1 Answers1

0

Closing, figured out an issue.

For those needing help using the valves JSON values http://steamcommunity.com/id/{customurl}/inventory/json/730/2 then foreach rgDescriptions to get the "type" which is kills.

Morgan
  • 52
  • 7