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

[TF2] Trade Requests


Post New Thread Reply   
 
Thread Tools Display Modes
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-08-2014 , 15:47   Re: [TF2] Trade Requests
Reply With Quote #11

Quote:
Originally Posted by Gutty View Post
maybe have the ability to trade someone that isn't in game, but has to have joined the server so the credentials are on your system...
I might look into this later. There's a few issues that I'll discuss here later.

Quote:
Originally Posted by braak0327 View Post
support trade bot = riot on this thread
I don't understand your message.
__________________
ddhoward is offline
braak0327
AlliedModders Donor
Join Date: Dec 2012
Location: NORT....SOUTH KOREA
Old 08-08-2014 , 22:43   Re: [TF2] Trade Requests
Reply With Quote #12

can you made trade bot feature?

it will be so awesome with some TF2 gambling servers (use for middleman bot) or server donation things
__________________
I'M KIMCHI
braak0327 is offline
Send a message via Skype™ to braak0327
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-08-2014 , 23:47   Re: [TF2] Trade Requests
Reply With Quote #13

Quote:
Originally Posted by braak0327 View Post
can you made trade bot feature?

it will be so awesome with some TF2 gambling servers (use for middleman bot) or server donation things
That is not at all related to this plugin.
__________________
ddhoward is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-21-2014 , 18:29   Re: [TF2] Trade Requests
Reply With Quote #14

Valve's apparent changes to how Steam IDs are written in today's update has broken this plugin. I will work on a fix as soon as admin access in general is restored to Sourcemod.
__________________
ddhoward is offline
ShadowManGer
Member
Join Date: May 2013
Old 08-28-2014 , 19:52   Steam64 fix
Reply With Quote #15

Hey,
i checked out the GetSteamID64 function and rewrote it to support the new SteamID format.

Code:
stock bool:GetSteamID64(client, String:steam64[], size)
{
	if (client < 1 || client > MaxClients || !IsClientAuthorized(client) || IsFakeClient(client)) return false;
	
	new String:Steam32[64];
	if(!GetClientAuthString(client, Steam32, sizeof(Steam32)))
	{
		LogError("GetSteamID64() error: GetClientAuthString on client %i failed!", client);
		return false;
	}
	
	if(strncmp(Steam32, "STEAM_", 6, false) == 0 &&
	   Steam32[7] == ':' &&
	   Steam32[9] == ':')
	{
		new iUpper = 765611979; 
		new iFriendID = StringToInt(Steam32[10])*2 + 60265728 + Steam32[8]-48; 

		new iDiv = iFriendID/100000000; 
		new iIdx = 9-(iDiv?iDiv/10+1:0); 
		iUpper += iDiv; 
		 
		IntToString(iFriendID, steam64[iIdx], size-iIdx); 
		iIdx = steam64[9]; 
		IntToString(iUpper, steam64, size); 
		steam64[9] = iIdx; 

		return true;
	}
	else if(strncmp(Steam32, "[U:1:", 5, false) == 0 &&
			StrContains(Steam32, "]", false) > 5)
	{
		ReplaceString(Steam32, sizeof(Steam32), "[U:1:", "");
		ReplaceString(Steam32, sizeof(Steam32), "]", "");
		
		new Steam32Int = StringToInt(Steam32);
		Format(steam64, size, "765611979%i", Steam32Int + 60265728);
		
		return true;
	}
	
	steam64[0] = '\0'; 
	LogError("GetSteamID64() error: Steam ID conversion failed! SteamID32 given was: %s", Steam32);
	return false;
}
Hope it will help you.

Kind regards
Shadow_Man
ShadowManGer is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 08-29-2014 , 02:24   Re: [TF2] Trade Requests
Reply With Quote #16

Ahhhh shit I completely forgot about updating this one.

I'll get to it very soon, I promise. I have a lot on my plate.

EDIT: An update is apparently not necessary if running a 1.6 snapshot. I'll do one anyway within the next few days.
__________________

Last edited by ddhoward; 08-29-2014 at 03:50.
ddhoward is offline
ShadowManGer
Member
Join Date: May 2013
Old 09-06-2014 , 17:44   Right Steam64 conversion
Reply With Quote #17

I noticed that i have posted a broken code for my steam64 calculation. So this code will work properly.

Code:
stock bool:GetSteamID64(client, String:steam64[], size)
{
	if (client < 1 || client > MaxClients || !IsClientAuthorized(client) || IsFakeClient(client)) return false;
	
	new String:Steam32[64];
	if(!GetClientAuthString(client, Steam32, sizeof(Steam32)))
	{
		LogError("GetSteamID64() error: GetClientAuthString on client %i failed!", client);
		return false;
	}
	
	if(strncmp(Steam32, "STEAM_", 6, false) == 0 &&
	   Steam32[7] == ':' &&
	   Steam32[9] == ':')
	{
		new iUpper = 765611979; 
		new iFriendID = StringToInt(Steam32[10])*2 + 60265728 + Steam32[8]-48; 

		new iDiv = iFriendID/100000000; 
		new iIdx = 9-(iDiv?iDiv/10+1:0); 
		iUpper += iDiv; 
		
		IntToString(iFriendID, steam64[iIdx], size-iIdx); 
		iIdx = steam64[9]; 
		IntToString(iUpper, steam64, size); 
		steam64[9] = iIdx; 

		return true;
	}
	else if(strncmp(Steam32, "[U:1:", 5, false) == 0 &&
			StrContains(Steam32, "]", false) > 5)
	{
		ReplaceString(Steam32, sizeof(Steam32), "[U:1:", "");
		ReplaceString(Steam32, sizeof(Steam32), "]", "");
		
		new Steam32Int = StringToInt(Steam32);
		new iUpper = 765611979;
		new iFriendID = Steam32Int + 60265728;

		new iDiv = iFriendID/100000000;
		new iIdx = 9-(iDiv?iDiv/10+1:0);
		iUpper += iDiv;
		
		IntToString(iFriendID, steam64[iIdx], size-iIdx);
		iIdx = steam64[9];
		IntToString(iUpper, steam64, size);
		steam64[9] = iIdx;
		
		return true;
	}
	
	steam64[0] = '\0'; 
	LogError("GetSteamID64() error: Steam ID conversion failed! SteamID32 given was: %s", Steam32);
	return false;
}

Last edited by ShadowManGer; 09-06-2014 at 17:56.
ShadowManGer is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 09-13-2014 , 20:06   Re: [TF2] Trade Requests
Reply With Quote #18

Recent snapshots of Sourcemod 1.7 (and all future ones) have a function built in to obtain a user's community profile number. So the include will soon be unnecessary.
__________________

Last edited by ddhoward; 09-13-2014 at 20:06.
ddhoward is offline
Hydrooxygen
Junior Member
Join Date: Oct 2014
Old 11-11-2014 , 15:11   Re: [TF2] Trade Requests
Reply With Quote #19

I have this plugin installed, it works for most people as the pop up menu shows up when you press esc. But it doesnt work for me, would you have any idea why?
Hydrooxygen is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 07-26-2015 , 02:26   Re: [TF2] Trade Requests
Reply With Quote #20

Updated to version 15.0725. Changes include:
  • Updated to use transitional syntax.
  • Switch from GetClientAuthString to GetClientAuthId, which removes the need for the getsteamid64 include.
  • Other small changes, such as updated inc files being used.
__________________
ddhoward 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 12:31.


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