Raised This Month: $ Target: $400
 0% 

check if user is admin or not


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Thread Tools
Display Modes

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 11:14.


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