Плагин считывает читерские квары, только что то не то пошло и ошибка
Код:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Commands filter"
#define VERSION "0.1"
#define AUTHOR "Chuvi"
new Trie:BadCommands=Invalid_Trie;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
ReadConfigFile()
}
public plugin_end()
{
TrieClear(BadCommands)
TrieDestroy(BadCommands)
}
public ReadConfigFile()
{
new szCfgFile[300]
get_configsdir(szCfgFile,charsmax(szCfgFile))
new Len=strlen(szCfgFile);
format(szCfgFile[Len],charsmax(szCfgFile)-Len,"/BadCommands.ini");
//server_print("ReadConfigFile %s",szCfgFile);
if(!file_exists(szCfgFile))
{
abort(AMX_ERR_NOTFOUND,"File %s not found!",szCfgFile);
return 0;
}
server_print("File exists");
new CfgFile=fopen(szCfgFile,"rt");
if(!CfgFile)
{
abort(AMX_ERR_MEMACCESS,"Unable to open %s for reading!",szCfgFile);
return 0;
}
BadCommands=TrieCreate();
new szCmdGroup[100];
new szCmd[100];
new szBuf[200];
new szGarbage[100];
new Line=0;
new NumCmds=0;
format(szCmdGroup,charsmax(szCmdGroup),"DefaultGroup");
while(!feof(CfgFile))
{
Line++;
fgets(CfgFile,szBuf,charsmax(szBuf));
trim(szBuf);
if(!szBuf[0]||szBuf[0]==';'||(szBuf[0]=='/'&&szBuf[1]=='/'))
{
//server_print("Line %i (^"%s^") skipped.",Line,szBuf);
continue;
}
if(szBuf[0]=='[')
{
strtok(szBuf[1],szCmdGroup,charsmax(szCmdGroup),szGarbage,charsmax(szGarbage),']',0);
//server_print("Group=%s",szCmdGroup);
continue;
}
strtok(szBuf[0],szCmd,charsmax(szCmd),szGarbage,charsmax(szGarbage),';',0);
TrieSetString(BadCommands,szCmd,szCmdGroup)
NumCmds++;
//server_print("Cmd ^"%s^" -> ^"%s^"",szCmd,szCmdGroup);
}
fclose(CfgFile);
return NumCmds;
}
public client_putinserver(id){
set_task(0.1,"query_client",id);
}
public query_client(id)
{
query_client_cvar(id,BadCommands,"cvar_result_pitch");
return PLUGIN_CONTINUE
}
public cvar_result_pitch(id, const cvar[], const value[])
{
if(!is_user_bot(id)||!is_user_hltv(id))
{
if( value[0] != 'B' ) {
if(BadCommands==Invalid_Trie)
{
return PLUGIN_CONTINUE
}
new szCmdGroup[100];
if(TrieKeyExists(BadCommands,cvar))
{
TrieGetString(BadCommands,cvar,szCmdGroup,charsmax(szCmdGroup));
server_cmd("kick #%d %s Detected", get_user_userid(id),szCmdGroup);
}
}
}
return PLUGIN_CONTINUE
}
Ошибка:
Код:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2013 ITB CompuPhase, AMX Mod X Team
Error: Argument type mismatch (argument 2) on line 91
1 Error.
Could not locate output file E:\amxx\scripting\cmd_command.amx (compile failed).