Quote:
Originally Posted by fjlep
I want to avoid using the console, I like to use the "say .lo3" =D
|
Add your config files to the array, excluding the ".cfg" extension. Do you want to limit who can execute config files to admins only?
This will support saying /lo3 or .lo3
PHP Code:
#include <amxmodx>
new const Version[] = "0.1";
new const configs[][] =
{
"lo3",
"lo4",
"lo5"
};
public plugin_init()
{
register_plugin( "Say Exec Config" , Version , "bugsy" );
register_clcmd( "say" , "SayHook" );
register_clcmd( "say_team" , "SayHook" );
}
public SayHook()
{
new szArg[ 8 ];
read_argv( 1 , szArg , charsmax( szArg ) );
for ( new i = 0 ; i < sizeof( configs ) ; i++ )
{
if ( equal( szArg[ 1 ] , configs[ i ] ) )
{
server_cmd( "exec %s.cfg" , szArg[ 1 ] );
break;
}
}
}
__________________