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

Test for steam ID?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrTimcakes
Senior Member
Join Date: Jan 2012
Location: Uk
Old 07-12-2015 , 11:16   Test for steam ID?
Reply With Quote #1

I'm looking to apply a SDKHook but only to specific SteamID's from OnClientPutInServer. How do I use GetClientAuthId to compair vs "STEAM_0:1:46710145" or "[U:1:93420291]"?
__________________
MrTimcakes is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-12-2015 , 12:08   Re: Test for steam ID?
Reply With Quote #2

You need to do it in OnClientAuthorized or OnClientPostAdminCheck as you can't be sure that they have a Steam ID before that.

It's better to use GetClientAuthId to get it in the format you want rather than relying on the String OnClientAuthorized gets passed in.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
MrTimcakes
Senior Member
Join Date: Jan 2012
Location: Uk
Old 07-12-2015 , 13:34   Re: Test for steam ID?
Reply With Quote #3

What type of variable does GetClientAuthId return? Is it a string, can I use strEqual?
__________________
MrTimcakes is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 07-12-2015 , 13:49   Re: Test for steam ID?
Reply With Quote #4

GetClientAuthId(client, AuthIdType, buffer[], maxlen);

If AuthId_Steam2: "STEAM_1:BLAHBLAH"
If AuthId_Steam3: "[U:1:BLAHBLAH]"
thecount is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-12-2015 , 13:53   Re: Test for steam ID?
Reply With Quote #5

AuthId_Engine being what ever the game uses, for tf2, that's AuthId_Steam3
AuthId_Steam64 being the format that is usually used for steam web related stuff.
__________________
WildCard65 is offline
MrTimcakes
Senior Member
Join Date: Jan 2012
Location: Uk
Old 07-12-2015 , 15:46   Re: Test for steam ID?
Reply With Quote #6

Got it working, for anyone who wants to use it:
PHP Code:
public OnClientPostAdminCheck(client){
    
decl String:player_authid[32];
    
GetClientAuthId(clientAuthId_Steam3player_authidsizeof(player_authid));
    if(
StrEqual(player_authid"[U:1:93420291]")){
        
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    }

Also what do the & symbols do in OnTakeDamage function?
e.g.public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype){
__________________

Last edited by MrTimcakes; 07-12-2015 at 15:47.
MrTimcakes is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-12-2015 , 17:17   Re: Test for steam ID?
Reply With Quote #7

Pass by reference
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-12-2015 , 18:00   Re: Test for steam ID?
Reply With Quote #8

Giving yourself godmode
__________________
Neuro Toxin 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 09:48.


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