Raised This Month: $51 Target: $400
 12% 

PHP help needed for steamID converter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-07-2009 , 18:23   PHP help needed for steamID converter
Reply With Quote #1

I think we all know the SteamID to steam community url converters. Sourcebans convert for each ban automaticly the steamID to steam community url so you can quik visit the steam community profile from each banned player.

I'm trying to do this for AMXBans to but without succes so far. My question is if someone know how to make this and want to help me?

Same question for detecting if an steam account is VAC banned or not. There is an AMXX plugin wich does this in game but i would like to add this to to AMXBans but again i dont know how to do this.

edit: can a moderator please move this topic to the Off-Topic / General Chat forum.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 02-07-2009 at 18:58.
Maurice is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 02-07-2009 , 19:26   Re: PHP help needed for steamID converter
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=77361

Take a look at the plugins code and you'll find what you need.
__________________

Community / No support through PM
danielkza is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-07-2009 , 20:02   Re: PHP help needed for steamID converter
Reply With Quote #3

Thanks for the tip but i already tried that without succes.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 02-07-2009 , 20:39   Re: PHP help needed for steamID converter
Reply With Quote #4

Quote:
Originally Posted by Maurice View Post
Thanks for the tip but i already tried that without succes.
What exactly was your problem?
__________________

Community / No support through PM
danielkza is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-07-2009 , 23:59   Re: PHP help needed for steamID converter
Reply With Quote #5

I readed the script code from the AMXX plugins, tried to understand as much as possible but unfortunely i coudn't find anything what i recognized for using in the AMXBans PHP files. I've also readed the SourceBans PHP files but the same, i can't find anything wich i can copy. But if i have to be honest i don't know much about about PHP.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 02-08-2009 , 01:39   Re: PHP help needed for steamID converter
Reply With Quote #6

Quote:
Originally Posted by Maurice View Post
I readed the script code from the AMXX plugins, tried to understand as much as possible but unfortunely i coudn't find anything what i recognized for using in the AMXBans PHP files. I've also readed the SourceBans PHP files but the same, i can't find anything wich i can copy. But if i have to be honest i don't know much about about PHP.
Did you really read my code? There is a function called GetFriendID. There are only 3 functions, and only one of them takes a SteamID. Could it be any more obvious?
__________________

Community / No support through PM
danielkza is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-08-2009 , 14:49   Re: PHP help needed for steamID converter
Reply With Quote #7

Here is my idea but i'm missing the red part, the actualy converting part.

// Inside the PHP file
$steamid = htmlentities($result->player_id, ENT_QUOTES);
$community_id = "$steamid + convert formule to steam_community_url"

// Asign variables to the array used in the template
"community_id" => $community_id,

// Link for in the template file
<td><a href='
http://steamcommunity.com/profiles/{community_id}'>{$bans.player_id}</a></td>



Here is the GetFriendID part you referred to but i don't know how to use it in the above script.

stock GetFriendID(const szAuthID[],szReturn[],iRetLen)
{
static const szFriendsBaseNum[] = "76561197960265728"
new szServer[2], szSteamID[64]

new iServerPos = containi(szAuthID,":")
if(iServerPos < 0)
return 0

strtok(szAuthID[iServerPos+1],szServer,charsmax(szServer),szSteamID,charsm ax(szSteamID),':',1)

//if(!is_str_num(szServer) || !is_str_num(szSteamID))
// return 0

// AuthID * 2
NumString_Add(szSteamID,szSteamID,szSteamID,c harsmax(szSteamID))

// AuthID + Base Number + Server Number
NumString_Add(szSteamID,szFriendsBaseNum,szSt eamID,charsmax(szSteamID))
NumString_Add(szSteamID,szServer,szSteamID,ch arsmax(szSteamID))

return (copy(szReturn,iRetLen,szSteamID) > 0)
}
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 02-09-2009 at 01:38.
Maurice is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 02-09-2009 , 14:54   Re: PHP help needed for steamID converter
Reply With Quote #8

I've found something in the HLX PHP files and edited it with the amxbans information. Now my question to the ones who have some PHP knowledge, is it a working php script?
PHP Code:
$community_id    cast(mid(player_id,9,1)  as unsigned) + cast('76561197960265728' as unsigned) + cast(mid(player_id11,10)*as unsigned) as community_id 
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
Reply



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 15:16.


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