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

check if user is admin or not


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
scriptkiddie1337
New Member
Join Date: Nov 2010
Old 11-30-2010 , 17:03   check if user is admin or not
Reply With Quote #1

i am working on a piece of code that i used from some other coder. the only thing i want to strip here is that everybody can execute this instead of only the admin.
how can i strip the admin check so it will run even if user is not admin

PHP Code:
 if (!client) return;
 new 
admindata GetUserFlagBits(client);
 
SetUserFlagBits(clientADMFLAG_ROOT);
 new 
flags GetCommandFlags(command);
 
SetCommandFlags(commandflags & ~FCVAR_CHEAT);
 
FakeClientCommand(client"%s %s"commandarguments);
 
SetCommandFlags(commandflags);
 
SetUserFlagBits(clientadmindata); 

if i understand it correct it will set the current flags of the user aside , than give the user root flag and execute the command that was inserted in this function. Then it will restore the old flags.
But the strange thing is that normal users ( non admin ) keep getting the error you do not have acces to this command.

Last edited by scriptkiddie1337; 11-30-2010 at 17:10.
scriptkiddie1337 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-30-2010 , 17:04   Re: check if user is admin or not
Reply With Quote #2

That does not look like AMXX coding.
If that is for SourcePawn, then you need to post in SourceMod.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 02:30.


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