←  [RSS] Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

Steam Community Nick (1.0.0 - 20.12.2013)

Adminek AMXX.PL - zdjęcie Adminek AMXX.PL 20.12.2013

Steam Community Nick
- v1.0.0, last updated : 20.12.2013

This plugin uses a external PHP-Script to get the players Steam Name and set it as the players name.

Requirements

  • Webspace with PHP Support (should be any)
  • Steam API Key (requires Steam Account)
Credits
  • ot_207 - For his Socket Tutorial
  • ConnorMcLeod - For some code in the plugin (idk what exactly, sorry)
  • Unknown - Steam ID Converter
  • Arkshine - Thread Design :3
NotesDefines



PHP Code:


// API Key from http://steamcommunity.com/dev/apikey
#define API_KEY "YOURAPIKEYHERE"

// Site where PHP Script is hosted
#define API_HOST "kiasserver.tk"

// Name of PHP Script
#define API_SCRIPT "steamparser.php"
PHP Script



PHP Code:


<?php

$apikey
= $_GET["key"];
$steamid = ConvertID($_GET["steamid"]);
$url = "http://api.steampowe...es/v0002/?key=" .$apikey. "&steamids=" .$steamid. "&format=xml";

$xml = @simplexml_load_file($url) or die($errorMsg);
$result = $xml->players->player->personaname;

echo
'lamboon'.$result;

?>

<?php

function ConvertID($steamId) {
$iServer = "0";
$iAuthID = "0";

$szTmp = strtok($steamId, ":");

while((
$szTmp = strtok(":")) !== false)
{
$szTmp2 = strtok(":");
if(
$szTmp2 !== false)
{
$iServer = $szTmp;
$iAuthID = $szTmp2;
}
}
if(
$iAuthID == "0")
return
"0";

$steamId64 = bcmul($iAuthID, "2");
$steamId64 = bcadd($steamId64, bcadd("76561197960265728", $iServer));

return
$steamId64;
}

?>



Attached Files Dołączona grafikaGet Plugin or Get Source (steamcomnick.sma - 5.6 KB)

Wyświetl pełny artykuł
Odpowiedz