Raised This Month: $ Target: $400
 0% 

Admin remove plugin bug help...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Firewall_
Senior Member
Join Date: Aug 2012
Old 08-04-2013 , 10:59   Re: Admin remove plugin bug help...
Reply With Quote #1

Quote:
Originally Posted by ConnorMcLeod View Post
If you remove the code, you won't be able to remove online players with partial names or with names if they are registered with steamid.
Would be better to let the code as it is, message is just a warning but code is still working fine.

Also, that code has been copy/pasted from amx2006, FYI.
yes connor. This part from amx2010 version. I dont want to delete online players or other. I will use this only my control panel for hlds.
Firewall_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-04-2013 , 13:01   Re: Admin remove plugin bug help...
Reply With Quote #2

Anyway, you can fully ignore that message.

You can use this :

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

#pragma semicolon 1

#define PLUGIN "Remove Admin"
#define VERSION "0.0.1"

#define cm(%0)    ( sizeof(%0) - 1 )

public plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );
    
register_srvcmd("amx_removeadmin""cmdRemoveAdmin");
}

public 
cmdRemoveAdmin()
{
    new 
szArg[32];
    
read_argv(1szArgcharsmax(szArg));

    new 
szAdminFile[64];
    
get_configsdir(szAdminFilecm(szAdminFile));
    
add(szAdminFilecm(szAdminFile), "/users.ini");

    new 
fplinebFound;
ReadFile:
    
fp fopen(szAdminFile"rt");
    
line = -1;
    if( 
fp )
    {
        new 
buffer[256], ckey[32];
        while( !
feof(fp) )
        {
            
line++;
            
fgets(fpbuffercharsmax(buffer));
            
trim(buffer);
            
buffer[0];
            if( 
&& != '#' && != ';' && !( == '/' && buffer[1] == '/' ) )
            {
                
parse(bufferkeycm(key));
                if( 
equal(keyszArg) )
                {
                    
bFound 1;
                    
fclosefp );
                    
fp 0;
                    
write_file(szAdminFile""line);
                    
console_print(0"Removed following line from users.ini : %s"buffer);
                    goto 
ReadFile;
                }
            }
        }
        
fclosefp );
        
fp 0;
    }

    if( 
bFound )
    {
        
server_cmd("amx_reloadadmins");
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-04-2013 at 13:56.
ConnorMcLeod 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 15:51.


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