View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-20-2024 , 23:25   Re: Execute cfg via chat
Reply With Quote #6

Quote:
Originally Posted by fjlep View Post
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];
    
    
read_argvszArg charsmaxszArg ) );
    
    for ( new 
sizeofconfigs ) ; i++ )
    {
        if ( 
equalszArg] , configs] ) )
        {
            
server_cmd"exec %s.cfg" szArg] );
            break;
        }
    }

__________________

Last edited by Bugsy; 04-21-2024 at 19:50.
Bugsy is offline