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

Solved cmdaccess not registering


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blAck.
Member
Join Date: Jun 2018
Old 07-19-2018 , 14:49   cmdaccess not registering
Reply With Quote #1

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
}

Last edited by blAck.; 08-05-2018 at 14:01.
blAck. is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-19-2018 , 14:52   Re: cmdaccess not registering
Reply With Quote #2

Code:
register_clcmd("say /ultra", "ultra_heal");
-->
Code:
register_conmd("/ultra", "ultra_heal");

Last edited by edon1337; 07-19-2018 at 14:53.
edon1337 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-19-2018 , 14:53   Re: cmdaccess not registering
Reply With Quote #3

Did you not using any parameter to command, why in cmd_access you put 2?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
blAck.
Member
Join Date: Jun 2018
Old 07-19-2018 , 14:54   Re: cmdaccess not registering
Reply With Quote #4

Quote:
Originally Posted by edon1337 View Post
Code:
register_clcmd
-->
Code:
register_concmd
but can I do like
Code:
register_concmd("say /ultra", "ultra_heal")
?
blAck. is offline
blAck.
Member
Join Date: Jun 2018
Old 07-19-2018 , 14:55   Re: cmdaccess not registering
Reply With Quote #5

Quote:
Originally Posted by ^SmileY View Post
Did you not using any parameter to command, why in cmd_access you put 2?
what do you mean?
blAck. is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-19-2018 , 14:55   Re: cmdaccess not registering
Reply With Quote #6

Quote:
Originally Posted by blAck. View Post
but can I do like
Code:
register_concmd("say /ultra", "ultra_heal")
?
If you want to make yourself write 'say /ultra' in console, sure.
edon1337 is offline
blAck.
Member
Join Date: Jun 2018
Old 07-19-2018 , 15:00   Re: cmdaccess not registering
Reply With Quote #7

Quote:
Originally Posted by edon1337 View Post
If you want to make yourself write 'say /ultra' in console, sure.
Wait, so cmdaccess.ini registers only concmd commands?
blAck. is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-19-2018 , 15:02   Re: cmdaccess not registering
Reply With Quote #8

Quote:
Originally Posted by blAck. View Post
Wait, so cmdaccess.ini registers only concmd commands?
I don't know what cmdaccess.ini has to do with concmd commands.
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-19-2018 , 15:07   Re: cmdaccess not registering
Reply With Quote #9

cmdaccess.ini doesn't register commands that start with "say".
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 07-19-2018, 15:18
blAck.
This message has been deleted by blAck..
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-19-2018 , 15:29   Re: cmdaccess not registering
Reply With Quote #10

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
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 18:42.


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