Raised This Month: $ Target: $400
 0% 

"If(GetUserSteam" ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avlisrotiv
Member
Join Date: May 2010
Old 09-11-2010 , 21:21   "If(GetUserSteam" ?
Reply With Quote #1

This exist:
PHP Code:
if(GetUserSteam == STEAM:0...)
return 
Plugin_Continue
?
Or something like this, please?
avlisrotiv is offline
rcarm
Member
Join Date: Feb 2010
Old 09-11-2010 , 21:28   Re: "If(GetUserSteam" ?
Reply With Quote #2

Use GetClientAuthString() to get someone's SteamID
http://docs.sourcemod.net/api/index....d=show&id=401&

and use StrEqual() or strcmp() to compare.
http://docs.sourcemod.net/api/index.php?fastload=show&id=618&
http://docs.sourcemod.net/api/index.php?fastload=show&id=616&

Last edited by rcarm; 09-11-2010 at 21:58. Reason: wrong links :/
rcarm is offline
avlisrotiv
Member
Join Date: May 2010
Old 09-11-2010 , 21:36   Re: "If(GetUserSteam" ?
Reply With Quote #3

LOL, thank you, but... I don't understand nothing one this pages... : |
I don't see the commands, lol...
You can write some example, like the first one, please?
EDIT:
PHP Code:
if(GetClientAuthString == STEAM:0blabla...)
return 
Plugin_Continue
?
Is this?

EDIT2:
Better... What command to:
"AddUserFlags"
Add a temporary admin flag?

Last edited by avlisrotiv; 09-11-2010 at 21:42.
avlisrotiv is offline
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 09-11-2010 , 21:54   Re: "If(GetUserSteam" ?
Reply With Quote #4

Nah heres how u do it

Code:
decl String:Auth[32]; 
GetClientAuthString( Client, Auth, sizeof(Auth));

if( StrEqual(Auth, "STEAM_BLABLSGDS", false ) )
{
//Do whatever
}
__________________
"I give sopport and knolage in making extractions"
"MASTER(D) - dun0: are you mocing me?" -Master the grate

Plugins
Godmode Until Attack | No Block Team Filter
Extensions
Rcon Hooks
Samantha is offline
avlisrotiv
Member
Join Date: May 2010
Old 09-11-2010 , 22:42   Re: "If(GetUserSteam" ?
Reply With Quote #5

That's it, thank you!
But make error on compilation: "error 017: undefined symbol 'Client'"
Any idea?

Last edited by avlisrotiv; 09-11-2010 at 23:01.
avlisrotiv is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 09-11-2010 , 22:51   Re: "If(GetUserSteam" ?
Reply With Quote #6

PHP Code:
// ! infront of StrEqual means NOT. So if it's NOT equal, that turns true.
// || means OR
if(!StrEqual(Auth"STEAM_BLAH"false) || !StrEqual(Auth"STEAM_BLAH"false) || and so on...)
return 
Plugin_Handled
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
avlisrotiv
Member
Join Date: May 2010
Old 09-11-2010 , 23:07   Re: "If(GetUserSteam" ?
Reply With Quote #7

Quote:
Originally Posted by Monkeys View Post
PHP Code:
// ! infront of StrEqual means NOT. So if it's NOT equal, that turns true.
// || means OR
if(!StrEqual(Auth"STEAM_BLAH"false) || !StrEqual(Auth"STEAM_BLAH"false) || and so on...)
return 
Plugin_Handled
Well, i can make something...
PHP Code:
decl String:Auth[32]; 
GetClientAuthStringClientAuthsizeof(Auth));

*if(
GetUserAdmin(id) == INVALID_ADMIN_ID) || StrEqual(Auth"STEAM_BLABLSGDS"false)
return 
Plugin_Continue
?
And if not user "STEAM_BLABLSGDS" give the same error ("INVALID_ADMIN_ID")?
And now, compiling give the error "error 029: invalid expression, assumed zero" to line *4...
Thank you.

Last edited by avlisrotiv; 09-12-2010 at 00:09.
avlisrotiv is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 09-12-2010 , 01:25   Re: "If(GetUserSteam" ?
Reply With Quote #8

Quote:
Originally Posted by avlisrotiv View Post
Well, i can make something...
PHP Code:
decl String:Auth[32]; 
GetClientAuthStringClientAuthsizeof(Auth));

*if(
GetUserAdmin(id) == INVALID_ADMIN_ID) || StrEqual(Auth"STEAM_BLABLSGDS"false)
return 
Plugin_Continue
?
And if not user "STEAM_BLABLSGDS" give the same error ("INVALID_ADMIN_ID")?
And now, compiling give the error "error 029: invalid expression, assumed zero" to line *4...
Thank you.
What's with the * on that if statement?

But anyways, where on earth did id come from?

PHP Code:
decl String:Auth[32];
GetClientAuthString(clientAuthsizeof(Auth));

*if(
GetUserAdmin(client) == INVALID_ADMIN_ID) || !StrEqual(Auth"STEAM_BLABLSGDS"false)
return 
Plugin_Handled
You're going to have to say what you're wanting to do if you require more help. I'm pulling at straws and I'm pretty sure no one else knows either.


EDIT: In order to prevent errors, you're going to need a check to see if the client is connected (and probably authorized). IsClientAuthorized should do the trick provided false is returned if the client index is invalid.

Last edited by KyleS; 09-12-2010 at 01:32.
KyleS is offline
avlisrotiv
Member
Join Date: May 2010
Old 09-12-2010 , 01:48   Re: "If(GetUserSteam" ?
Reply With Quote #9

PHP Code:
if(GetUserAdmin(id) == INVALID_ADMIN_ID) || !StrEqual(Auth"STEAM_0:0:32868509"false)
        return 
Plugin_Continue
Not work, give a same error, "error 029: invalid expression, assumed zero" on first line.


PHP Code:
if(GetUserAdmin(id) == INVALID_ADMIN_ID)
        return 
Plugin_Continue
Work.

I just want the plugin work for the admin's + one (or more) Steam ID...
avlisrotiv is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 09-12-2010 , 04:12   Re: "If(GetUserSteam" ?
Reply With Quote #10

Quote:
Originally Posted by avlisrotiv View Post
PHP Code:
if(GetUserAdmin(id) == INVALID_ADMIN_ID) || !StrEqual(Auth"STEAM_0:0:32868509"false)
        return 
Plugin_Continue
Not work, give a same error, "error 029: invalid expression, assumed zero" on first line.


PHP Code:
if(GetUserAdmin(id) == INVALID_ADMIN_ID)
        return 
Plugin_Continue
Work.

I just want the plugin work for the admin's + one (or more) Steam ID...
Oh crap, sorry... The fault lies in the brackets.

PHP Code:
if((GetUserAdmin(id) == INVALID_ADMIN_ID) && !StrEqual(Auth"STEAM_0:0:32868509"false) && !StrEqual(Auth"STEAM_0:0:Blah"false) && !StrEqual(Auth"STEAM_0:0:Etcetera"false))
return 
Plugin_Continue
Hopefully that works, sorry

Last edited by KyleS; 09-12-2010 at 04:21.
KyleS 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 16:59.


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