Raised This Month: $ Target: $400
 0% 

Spy admin error?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 03-17-2011 , 13:49   Spy admin error?
Reply With Quote #1

Can this plugin fuck my users.ini or interfer with the is_user_admin native? I know it does (hide) remove the admins flag and set it after back. This is the plugin ( http://forums.alliedmods.net/showthread.php?t=28034 ) :

PHP Code:
#include <amxmodx>
#include <amxmisc>

//USAGE: say /spyadmin, toggles your admin on/off
// by Smokey485

new spy[33]; // is the user a spy
new oldflags[33]; // the users old flags for admin

public plugin_init()
{
    
register_plugin("SpyAdmin v1""1.01""Smokey485")
    
register_clcmd("say /spy""spy_toggle", -1)
    
register_clcmd("amx_spyadmin""spy_toggle", -1)
}
public 
spy_toggle(id)
{
    
//although people who aren't admin can use this, its okay because they will just get the z flag anyway
    
    
if(spy[id] == 1)
    {
        
set_user_flags(id,oldflags[id],0)
        
client_print(id,print_chat,"[SPYADMIN] You are now back to your previous admin state.")
        new 
zflag read_flags("z")
        if(
containi(oldflags[id], "a") || containi(oldflags[id], "c") || containi(oldflags[id], "d") || containi(oldflags[id], "j"))
        
remove_user_flags(id,zflag,0)
        
spy[id] = 0
        
return PLUGIN_HANDLED;
    }
    if(
spy[id] == 0)
    {
        
oldflags[id] = get_user_flags(id)
        
client_print(id,print_chat"[SPYADMIN] You are now hidden as an admin.")
        
spy[id] = 1
        remove_user_flags
(id,oldflags[id],0)
        new 
zflag read_flags("z")
        
set_user_flags(idzflag0)
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}
public 
client_putinserver(id)
{
    
spy[id] = 0
    oldflags
[id] = 0

bibu 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 14:39.


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