Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.62 KB | None | 0 0
  1. <?php
  2.  
  3.       function isingarnetgroup( $playerid, $url )
  4.       {
  5.  
  6.             $random = rand();
  7.  
  8.             if ( !isset( $url ) )
  9.             {
  10.                   $url = 'http://steamcommunity.com/groups/garnetgaming/memberslistxml/?xml=1&r=' . $random;
  11.             }
  12.             else
  13.             {
  14.                   $url = $url . $random
  15.             }
  16.  
  17.             $group = simplexml_load_file( $url, 'SimpleXMLElement', LIBXML_NOWARNING ); // i guess this is the right way to do it
  18.             if ( !$group )
  19.             {
  20.                 die( 'group error' );
  21.             }
  22.             $groupusers = $group->members;
  23.             $isingroup = false;
  24.  
  25.             foreach ( $groupusers->steamID64 as $userid ) // fuckin loops confusin me n shit
  26.             {
  27.  
  28.                   if ( $userid == $playerid )
  29.                   {
  30.  
  31.                         $isingroup = true;
  32.                         break; // Break the gay ass loop
  33.  
  34.                   }
  35.  
  36.             }
  37.  
  38.             // Checking the next page if available
  39.  
  40.             if ( $group->nextPageLink && $found == false )
  41.             {
  42.                   $found = isingarnetgroup( $playerid, ( string )$group->nextPageLink . '&r=' . $random );
  43.             }
  44.  
  45.             return $found;
  46.  
  47.       }
  48.  
  49.       echo( ( string )isingroup( 76561198089465570, 'http://steamcommunity.com/groups/garnetgaming/memberslistxml/?xml=1&r=' ) );
  50.  
  51.       if ( !isset( $_POST[ 'playerid' ] ) )
  52.       {
  53.             return;
  54.       }
  55.  
  56.       $apikey = '3C662D6DDF7CC31B603C96D82224EDE4';
  57.       $playerid = $_POST[ 'playerid' ];
  58.  
  59.       echo( isingarnetgroup( $playerid ) );
  60.  
  61. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement