View Single Post
Meelo
Member
Join Date: Aug 2010
Old 04-07-2021 , 08:10   Re: check prefix of fps_max or any other command
Reply With Quote #8

Quote:
Originally Posted by LondoN View Post
Code:
#include < amxmodx >
#include < amxmisc >

public client_command ( iEntity ) {
	if ( is_user_connected ( iEntity ) && !is_user_bot ( iEntity ) ) {
		if ( is_user_admin ( iEntity ) )	return PLUGIN_HANDLED;

		new szCommandString [ 32 ];
		read_argv ( 1, szCommandString, charsmax ( szCommandString ) );
		
		if ( containi ( szCommandString, "fps" ) != -1 ) {
			is_user_alive ( iEntity ) ? user_silentkill ( iEntity ) : client_print ( iEntity, print_console, "You can't modify fps_max value" );
			return PLUGIN_CONTINUE;
		}
	}

	return PLUGIN_CONTINUE;
}
you can try this way

I didn't test it but i think it will catch everyone who type any command with "fps" in it's name so it can't work this way

Maybe make an exclude for fps_max only? I don't want to block legal commands for people.

Last edited by Meelo; 04-07-2021 at 08:17. Reason: idea
Meelo is offline