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

Question with register_Xcmd()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BLACO
Junior Member
Join Date: Dec 2007
Location: Espaņa / Spain
Old 01-18-2008 , 12:52   Question with register_Xcmd()
Reply With Quote #1

[Sorry 4 my english (Spanish)]
I want to make a cmd what i can use in server or in client console. I want to that this cmd can be a cvar. It's possible that?

I tried this.

PHP Code:
register_cvar("amx_scnd","0",FCVAR_SERVER|FCVAR_PRINTABLEONLY|FCVAR_SPONLY);
register_concmd("amx_scnd","activar",ADMIN_RCON|ADMIN_ADMIN,"<1|0>");
register_srvcmd("amx_scnd","activar",-1,"<1|0>"
and then

PHP Code:
public activar(id,level,cid) {
    if (!
cmd_access(id,level,cid,2)) {
        return   
PLUGIN_HANDLED
    
}
....

BLACO is offline
Send a message via Skype™ to BLACO
_Master_
Senior Member
Join Date: Dec 2006
Old 01-18-2008 , 13:38   Re: Question with register_Xcmd()
Reply With Quote #2

1) ADMIN_ADMIN implies that any admin can use it. ADMIN_RCON test will never fail if cmd_access() is used.
2) FCVAR_SPONLY cvars can only be changed via set_(p)cvar_*() natives so I don't get the point of having a command for this too ( server first test the input for a cvar THEN for a command ).
3) register_concmd() registers a command than can be used from ANY console ( server included )
_Master_ is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 01-18-2008 , 13:39   Re: Question with register_Xcmd()
Reply With Quote #3

You also registered a server command that was already registered because of register_concmd() - you probably confused this with register_clcmd().
Lee is offline
Old 01-18-2008, 13:41
Arkshine
This message has been deleted by Arkshine. Reason: nvm
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 21:35.


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