Quote:
Originally Posted by Bugsy
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 ); break; } } }
|
When I type .lo3 in chat in console I get this "couldn't exec .lo3.cfg" I have the files in /cstrike/, if I type /lo3 I get this exec /lo3.cfg: invalid path and I would like admin's only to be able to use this option.