AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problems with register_concmd (https://forums.alliedmods.net/showthread.php?t=308470)

orel56000 06-21-2018 08:30

Problems with register_concmd
 
I have done this:

Code:

public plugin_init()
{
        register_concmd("amx_orel1", "cmdOrel", ADMIN_KICK, "does nothing");
}

public cmdOrel(id, level, cid)
{
        client_print(0, print_chat, "%i", level);
        return 1;
}

When I write amx_orel in the console it prints me 4 (ADMIN_KICK).

But if I change the command access, it is stuck at the first access I have done:

Code:

public plugin_init()
{
        register_concmd("amx_orel1", "cmdOrel", ADMIN_BAN, "does nothing");
}

public cmdOrel(id, level, cid)
{
        client_print(0, print_chat, "%i", level);
        return 1;
}

prints 4 also...


It is bug or something, or I don't know how to use this command?

maqi 06-21-2018 08:38

Re: Problems with register_concmd
 
Its already registerd in cmdaccess.ini

OciXCrom 06-21-2018 08:41

Re: Problems with register_concmd
 
You know how to use it, but you don't know how AMXX works. Command access is stored in cmdaccess.ini after the plugin's first usage and the flag set in the .sma file has no effect anymore.

orel56000 06-21-2018 08:41

Re: Problems with register_concmd
 
Quote:

Originally Posted by maqi (Post 2598419)
Its already registerd in cmdaccess.ini

So it will be okay if I remove anything from this file? it will be rewriten, no?

OciXCrom 06-21-2018 08:42

Re: Problems with register_concmd
 
There's no point in removing it since it will reappear again after mapchange. Just change the flag from there, what's the point of editing the plugin and recompiling just for that?

orel56000 06-21-2018 08:45

Re: Problems with register_concmd
 
Quote:

Originally Posted by OciXCrom (Post 2598423)
There's no point in removing it since it will reappear again after mapchange. Just change the flag from there, what's the point of editing the plugin and recompiling just for that?

But basiclly my question is if i remove anything from this file, it will be writen again as the sma says I and there will be no problems? It will be re writen as ADMIN_BAN?

maqi 06-21-2018 08:50

Re: Problems with register_concmd
 
It will be rewritten with the default access registered in the plugin.

orel56000 06-21-2018 08:53

Re: Problems with register_concmd
 
Quote:

Originally Posted by maqi (Post 2598428)
It will be rewritten with the default access registered in the plugin.

Okay, thanks!!


All times are GMT -4. The time now is 19:00.

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