AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Invalid command (https://forums.alliedmods.net/showthread.php?t=134319)

reinert 08-03-2010 08:45

Invalid command
 
Hi, how to make command for players that if they type it in console they won't get a message like Unknown Invalid Command etc...

command should be like: amx_vmm (Vote mute menu).

DarkGod 08-03-2010 08:49

Re: Invalid command
 
Code:
//header public plugin_init() {     //register stuff     register_clcmd("amx_vmm", "cmdVmm", ...) } public cmdVmm(...) {     //my flashy code         return PLUGIN_HANDLED }

In short, return PLUGIN_HANDLED at the end of the command function.

Devil259 08-03-2010 10:45

Re: Invalid command
 
register_clcmd() should be register_concmd().

Correct me if I'm wrong. :mrgreen:

fysiks 08-03-2010 19:10

Re: Invalid command
 
Quote:

Originally Posted by Devil259 (Post 1260415)
register_clcmd() should be register_concmd().

Correct me if I'm wrong. :mrgreen:

That depends on what is in the function. You use register_clcmd() for things that can ONLY be use in-game. Menus is one example. You use register_concmd() when you want it to be able to be executed from in-game AND in the server console. amx_kick, amx_ban, etc.

minimiller 08-03-2010 20:15

Re: Invalid command
 
Quote:

Originally Posted by fysiks (Post 1260901)
That depends on what is in the function. You use register_clcmd() for things that can ONLY be use in-game. Menus is one example. You use register_concmd() when you want it to be able to be executed from in-game AND in the server console. amx_kick, amx_ban, etc.

when u say "server console" im guessing that means other external consoles aswell yea?
e.g. HLSW, web based things and such like

fysiks 08-04-2010 00:21

Re: Invalid command
 
Quote:

Originally Posted by minimiller (Post 1260992)
when u say "server console" im guessing that means other external consoles aswell yea?
e.g. HLSW, web based things and such like

Yes, HLSW uses the server console.

Devil259 08-04-2010 05:03

Re: Invalid command
 
Quote:

Originally Posted by fysiks (Post 1260901)
That depends on what is in the function. You use register_clcmd() for things that can ONLY be use in-game. Menus is one example. You use register_concmd() when you want it to be able to be executed from in-game AND in the server console. amx_kick, amx_ban, etc.

Ok thank you.


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

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