Quote:
Originally Posted by Shadows Adi
So, you need to register the command which you want to deal with:
PHP Code:
register_clcmd("slot1", "slot_handle") // use clcmd if you want to be a client console command
register_concmd("slot1", "slot_handle") // use concmd if you want the command to be executed from client console or server console.
When you registered the command, you need to create a public handle where to put the code in:
PHP Code:
public slot_handle( )
{
//inside the braces you put your code which you want to be executed when server/client type the command.
}
Good luck!
|
I try this but it has no effect, I can still use "slot2; slot1"
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug"
#define VERSION "1.0"
#define AUTHOR "author"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("slot2;slot1", "slot_handle");
}
public slot_handle(id)
{
//engclient_cmd(id, "slot2");
client_cmd(id, "slot2") //inside the braces you put your code which you want to be executed when server/client type the command.
}
And I don't know what I could put to cancel the command or something so I can't do that command "slot2;slot1" which bugs models of weapons in the plugin I'm using.