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

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 , 08:22   Admin remove plugin bug help...
Reply With Quote #1

hi guyz. I did amx_removeadmin command plugin from direct console. But i have small problem.

When i want to delete an admin, this command is deleting admin succesfully but i take this error:

amx_removeadmin OnurX
Client with that name or userid not found => what is this error? fix pls
[CSOYUNCU] "OnurX" admin removed => process success
[AMXX] Loaded 0 admins from file => process success


i want to fix "Client with that name or userid not found" error message... can you help me about this error.i attached sma thanks.
Attached Files
File Type: sma Get Plugin or Get Source (remove.sma - 538 views - 1.5 KB)
Firewall_ is offline
Old 08-04-2013, 09:30
Firewall_
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 08-04-2013 , 09:35   Re: Admin remove plugin bug help...
Reply With Quote #2

It means that the provided client name ("OnurX") wasn't found at the online client list
__________________
simanovich is offline
Firewall_
Senior Member
Join Date: Aug 2012
Old 08-04-2013 , 09:52   Re: Admin remove plugin bug help...
Reply With Quote #3

Quote:
Originally Posted by simanovich View Post
It means that the provided client name ("OnurX") wasn't found at the online client list
i think you didnt read this topic good...

after it error :
[CSOYUNCU] "OnurX" admin removed
[AMXX] Loaded 0 admins from file
Firewall_ is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-04-2013 , 09:55   Re: Admin remove plugin bug help...
Reply With Quote #4

... That message is shown because your plugin is trying to find a user connected with that name. Since you are not using it, remove this part

Code:
  new player = cmd_target(id, szName, 8)

  if(player) 
  {
    get_user_name(player, szName, 31)
    get_user_authid(player, szSteamid, 31)
    get_user_ip(player, szIP, 31, 1)
  }
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Firewall_
Senior Member
Join Date: Aug 2012
Old 08-04-2013 , 10:50   Re: Admin remove plugin bug help...
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
... That message is shown because your plugin is trying to find a user connected with that name. Since you are not using it, remove this part

Code:
  new player = cmd_target(id, szName, 8)

  if(player) 
  {
    get_user_name(player, szName, 31)
    get_user_authid(player, szSteamid, 31)
    get_user_ip(player, szIP, 31, 1)
  }
ah thank you very muchh yami...

problem solved
Firewall_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-04-2013 , 10:54   Re: Admin remove plugin bug help...
Reply With Quote #6

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Firewall_
Senior Member
Join Date: Aug 2012
Old 08-04-2013 , 10:59   Re: Admin remove plugin bug help...
Reply With Quote #7

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 #8

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
Firewall_
Senior Member
Join Date: Aug 2012
Old 08-04-2013 , 15:19   Re: Admin remove plugin bug help...
Reply With Quote #9

thanks for your script connor. I will use your codes my panels. Thanks again ;)
Firewall_ is offline
Firewall_
Senior Member
Join Date: Aug 2012
Old 08-04-2013 , 16:41   Re: Admin remove plugin bug help...
Reply With Quote #10

connor for remove steamid admins, what must i do ?
Firewall_ 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 09:55.


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