AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved cmdaccess not registering (https://forums.alliedmods.net/showthread.php?t=309275)

blAck. 07-19-2018 14:49

cmdaccess not registering
 
my commands won't register in cmdaccess, why?

Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>

public plugin_init() {
       
        register_clcmd("say /ultra", "ultra_heal");
}

public ultra_heal(id, level, cid)
{
        if(!cmd_access(id, level, cid, 2))
                return 1;
               
        set_user_health(id, 150)
        return PLUGIN_HANDLED
}


edon1337 07-19-2018 14:52

Re: cmdaccess not registering
 
Code:
register_clcmd("say /ultra", "ultra_heal");
-->
Code:
register_conmd("/ultra", "ultra_heal");

^SmileY 07-19-2018 14:53

Re: cmdaccess not registering
 
Did you not using any parameter to command, why in cmd_access you put 2?

blAck. 07-19-2018 14:54

Re: cmdaccess not registering
 
Quote:

Originally Posted by edon1337 (Post 2604860)
Code:
register_clcmd
-->
Code:
register_concmd

but can I do like
Code:
register_concmd("say /ultra", "ultra_heal")
?

blAck. 07-19-2018 14:55

Re: cmdaccess not registering
 
Quote:

Originally Posted by ^SmileY (Post 2604862)
Did you not using any parameter to command, why in cmd_access you put 2?

what do you mean?

edon1337 07-19-2018 14:55

Re: cmdaccess not registering
 
Quote:

Originally Posted by blAck. (Post 2604864)
but can I do like
Code:
register_concmd("say /ultra", "ultra_heal")
?

If you want to make yourself write 'say /ultra' in console, sure.

blAck. 07-19-2018 15:00

Re: cmdaccess not registering
 
Quote:

Originally Posted by edon1337 (Post 2604867)
If you want to make yourself write 'say /ultra' in console, sure.

Wait, so cmdaccess.ini registers only concmd commands?

edon1337 07-19-2018 15:02

Re: cmdaccess not registering
 
Quote:

Originally Posted by blAck. (Post 2604868)
Wait, so cmdaccess.ini registers only concmd commands?

I don't know what cmdaccess.ini has to do with concmd commands.

OciXCrom 07-19-2018 15:07

Re: cmdaccess not registering
 
cmdaccess.ini doesn't register commands that start with "say".

^SmileY 07-19-2018 15:29

Re: cmdaccess not registering
 
if(!cmd_access(id, level, cid, 2)) will need two parameters that return false and return 1 in your function.
Need to be 1 not 2 in this case.

Nothing to do with register_command string


All times are GMT -4. The time now is 12:17.

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