Raised This Month: $ Target: $400
 0% 

Steam Community Nick (1.0.4 - 21.12.2013)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-20-2013 , 13:31   Steam Community Nick (1.0.4 - 21.12.2013)
Reply With Quote #1

Steam Community Nick
- v1.0.4, last updated : 21.12.2013

This plugin uses a external PHP-Script to get the players Steam Name and set it as the players name.
You can also decide if you only want players with the Name "Player" to be forced to use their Steam name, and if Name changing is allowed.


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
  • Weasel - Original Idea

Notes
Defines

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"

// Flag for bypassing plugin
#define FLAG_BYPASS ADMIN_BAN 
Change Log
v1.0.2 : [ 21.12.2013 ]

Added Defines
PHP Code:
// If defined, only Players with the name "Player" will be forced to use their steam name
#define ONLY_PLAYER

// If defined, changing names will be blocked, otherwise it is allowed
//#define BLOCK_NAME_CHANGE 
v1.0.3 : [ 21.12.2013 ]

Added Defines
PHP Code:
// If defined, players with flag FLAG_BYPASS won't be affected by this plugin
#define ADMIN_BYPASS

#if defined ADMIN_BYPASS

// Flag for bypassing Plugin
#define FLAG_BYPASS ADMIN_BAN

#endif 
v1.0.4 : [ 21.12.2013 ]
  • Removed some Defines and replaced them with CVars
  • New CVars
    • steamcomnick_affecting (Default : 1) - If 1, only players with the name "Player" will be forced to change name, otherwise all players.
    • steamcomnick_block (Default : 0) - If 1, changing name is not allowed, otherwise it is.
PHP Script

PHP Code:
<?php

$apikey 
$_GET["key"];
$steamid ConvertID($_GET["steamid"]);
$url "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/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($steamId64bcadd("76561197960265728"$iServer)); 
     
    return 
$steamId64;
}

?>

Attached Files
File Type: sma Get Plugin or Get Source (steamcomnick.sma - 1332 views - 6.2 KB)
__________________

Last edited by Kia; 12-21-2013 at 13:44.
Kia is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode