a mini question.
is it right so or can i do it better?
PHP Code:
new Catch_Enable
new Catchcvar = CvarRegister( "amx_catch_enable", "1" )
CvarHookChange( Catchcvar,"Catch_Cvar" )
public Catch_Cvar( const handleCvar, const oldValue[], const newValue[], const cvarName[] )
{
catch_toggleForward( .enable = newValue[ 0 ] == '1' );
}
public catch_toggleForward(const bool:enable )
{
if(!enable)
{
client_print(0,print_chat,"Catchmod is now OFF")
Catch_Enable = 0
}
else
{
client_print(0,print_chat,"Catchmod is now ON")
Catch_Enable = 1
}
server_cmd("sv_restart 1")
}
PHP Code:
public Say_Command(id)
{
if(!Catch_Enable)
{
return PLUGIN_HANDLED
}
static say_args[64]
read_args(say_args, charsmax(say_args))
remove_quotes(say_args)
if(say_args[0] != '/')
{
return PLUGIN_CONTINUE
}
if(equali(say_args, "/install") || equali(say_args, "/installdb"))
{
if(get_user_flags(id) & ADMIN_KICK)
{
install_db(id)
}
else
{
ChatColor(id, "%L", LANG_PLAYER,"ERROR_NOT_ALLOWDED", PLUGIN)
}
}
return PLUGIN_CONTINUE
}
do i have to user get_cvar_num or is it ok so? ( both works )
__________________