filtras
Posted: 2011 Feb 15 18:18
Kodėl man jis neveikia?
taip sudėti pluginai:
Code: Select all
#include <amxmodx>#include <amxmisc> #define MAX_WORDS 150 // global variables for storing the swear list and replace list and their respective number of linesnew g_swearWords[MAX_WORDS][300]new g_swearsNamesnew g_swearsNum public plugin_init() { register_plugin("Swear Filter","1.0a","SuicideDog") register_clcmd("say","swearcheck") register_clcmd("say_team","swearcheck") readList()} readList() { new Configsdir[64] new swear_file[64] get_configsdir( Configsdir, 63 ) format(swear_file, 63, "%s/swear/swearwords.ini", Configsdir ) if ( !file_exists(swear_file) ) { server_print ( "==========================================================" ) server_print ( "[Swear Replacement] %s file not found", swear_file ) server_print ( "==========================================================" ) return } new len, i=0 while( i < MAX_WORDS && read_file( swear_file, i , g_swearWords[g_swearNum], 19, len ) ) { i++ if( g_swearWords[g_swearNum][0] == ';' || len == 0 ) continue g_swearNum++ } server_print ( "[Swear Replacement] loaded %d Swear words", g_swearNum ) } public swearcheck(id) { new szSaid[192] read_args(szSaid,191) new bool:found = false new pos, i = 0 while ( i < g_swearsNum ) { if ( (pos = containi(szSaid,g_swearsNames[i][1])) != -1 ){ new len = g_swearsNames[i][0] while(len--) szSaid[pos++] = '*' found = true continue } ++i } if ( found ){ new cmd[32] read_argv(0,cmd,31) engclient_cmd(id,cmd,szSaid) } return PLUGIN_CONTINUE }
taip sudėti pluginai:
Code: Select all
; AMX Mod X plugins ; Admin Base - Always one has to be activated;admin.amxx ; admin base (required for any admin-related);admin_sql.amxx ; admin base - SQL version (comment admin.amxx)admin_amxbans.amxxamxbans.amxx ; Basicadmincmd.amxx ; basic admin console commandsadminhelp.amxx ; help command for admin console commandsadminslots.amxx ; slot reservationmultilingual.amxx ; Multi-Lingual management ; Menusmenufront.amxx ; front-end for admin menuscmdmenu.amxx ; command menu (speech, settings)plmenu.amxx ; players menu (kick, ban, client cmds.);telemenu.amxx ; teleport menu (Fun Module required!)mapsmenu.amxx ; maps menu (vote, changelevel)pluginmenu.amxx ; Menus for commands/cvars organized by plugin ; Chat / Messagesamx_log_advanced.amxxadminchat.amxx ; console chat commandsswear_filter.amxxantiflood.amxx ; prevent clients from chat-flooding the serverscrollmsg.amxx ; displays a scrolling messageimessage.amxx ; displays information messagesadminvote.amxx ; vote commands ....