• 0

[php] BF2 stat script


Question

I just put together a script to output your ranked Battlefield 2 stats, just pass your nick to the function (note: apparently some nicks don't work depending on character usage). Bear in mind i threw it together in 5 mins this morning, so while criticism is welcome don't flame.

function misc_bf2($nick)
{
$rank = array(

      "0" => "Private",

      "1" => "Private First Class",

      "2" => "Lance Corporal",

      "3" => "Corporal",

      "4" => "Sergeant",

      "5" => "Staff Sergeant",

      "6" => "Gunnery Sergeant",

      "7" => "Master Sergeant",

      "8" => "First Sergeant",

      "9" => "Master Gunnery Sergeant",

      "10" => "Sergeant Major",

      "11" => "Sergeant Major of the Corps",

       );
$url = "http://bf2web.gamespy.com/ASP/getplayerinfo.aspx?nick=".urlencode($nick)."&info=rank,scor,kill,dethfile($url);
$stats = explode("\t", $raw[4]);

echo "Nick: ".$nick."<br />";
echo "Rank: ".$rank[$stats[3]]."<br />";
echo "Score: ".$stats[4]."<br />";
echo "Kills: ".$stats[5]."<br />";
echo "Deaths: ".$stats[6];
}

If you decide to use it, post where you've used it here :)

/k

Link to comment
https://www.neowin.net/forum/topic/343217-php-bf2-stat-script/
Share on other sites

7 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Doing that has only worked for me with the Enterprise version.
    • I like Neowin a lot, but this "article" is shady and misleading. We need an "editorial" flag and this isn't "news" it's "my cousin's dog's best friend posted on twitter about their snapchat account from their dog's owner that a bad thing happened, so it's NEWS." Thanks
    • Burrrrn. Bought COD WWII last month when it was on sale for PC. Oh well. Excellent game tho, and the PC version plays/looks amazing (and has it's own PC achievements). ...wondering if this is a lesson on waiting on sales. ...also hoping Rise of the Tomb Raider has it's own PC Achievements
    • Google Chrome 137.0.7151.120 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. Important to know! The offline installer links do not include the automatic update feature. Google Chrome 137.0.7151.120 changelog: [$7000][420697404] High CVE-2025-6191: Integer overflow in V8. Reported by Shaheen Fazim on 2025-05-27 [$4000][421471016] High CVE-2025-6192: Use after free in Profiler. Reported by Chaoyuan Peng (@ret2happy) on 2025-05-31 [425443272] Various fixes from internal audits, fuzzing and other initiatives Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | 128.0 MB Download: Google Chrome Offline Installer 32-bit | 115.0 MB Download page: Google Chrome Portable Download: Google Chrome MSI Installers for Windows (automatic update) View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      gatilogistic earned a badge
      One Month Later
    • One Year In
      Custom Greek Shirts earned a badge
      One Year In
    • One Month Later
      Custom Greek Shirts earned a badge
      One Month Later
    • Week One Done
      Custom Greek Shirts earned a badge
      Week One Done
    • Week One Done
      topantidetectbrowser earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      672
    2. 2
      ATLien_0
      281
    3. 3
      Michael Scrip
      223
    4. 4
      +FloatingFatMan
      190
    5. 5
      Steven P.
      146
  • Tell a friend

    Love Neowin? Tell a friend!