关于反作弊插件Reallite_Files_Checker的代码修改问题
#include <amxmodx>#include <amxmisc>
#include <fakemeta>
#include <engine>
#define PLUGIN "Reallite Files Checker"
#define VERSION "0.4"
#define AUTHOR "DJ_WEST"
static const FilesUrl[] = "www.reallite.cs2.ru"
static const Reason[] = "Please use only standart files"
new g_MsgTime
new g_FilesUrl
new g_Reason
new g_Enable
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_dictionary ("reallite_fc.txt")
g_MsgTime = register_cvar("rfc_msgtime", "300.0")
g_FilesUrl = register_cvar("rfc_filesurl",FilesUrl)
g_Reason = register_cvar("rfc_reason",Reason)
g_Enable = register_cvar("rfc_enable", "1", 0)
set_task(5.0, "LoadInfoMsg")
}
public LoadInfoMsg()
{
set_task(get_pcvar_float(g_MsgTime), "InfoMsg", 4342, "", 0, "b")
}
public plugin_precache()
{
register_forward (FM_PrecacheModel, "File_Precache")
register_forward (FM_PrecacheSound, "File_Precache")
register_forward (FM_PrecacheGeneric, "File_Precache")
new ConfigsDir, ChecksFile
get_configsdir(ConfigsDir, 63)
format (ChecksFile,96,"%s/reallite_fc.cfg",ConfigsDir)
if (!file_exists (ChecksFile))
log_amx ("ERROR: %s doesn't exist.",ChecksFile)
else
{
new RFC_Text
new a, Position = 0
while (read_file(ChecksFile,Position++,RFC_Text,63,a))
{
if (RFC_Text != ';' && !equal(RFC_Text,""))
Enforce (RFC_Text)
}
}
}
public File_Precache(const File[])
{
Enforce (File)
return FMRES_IGNORED
}
public Enforce(const File[])
{
new FileWav
format (FileWav,64,"sound/%s",File)
if (file_exists(File))
force_unmodified (force_exactfile,{0,0,0},{0,0,0},File)
else if (file_exists(FileWav))
force_unmodified (force_exactfile,{0,0,0},{0,0,0},File)
}
public inconsistent_file(id, const filename[], reason)
{
new Name, AuthID, IP, UserID, FilesUrl, NewFileName, Reason
get_user_authid(id,AuthID,31)
get_user_ip(id,IP,31)
get_user_name(id,Name,31)
UserID = get_user_userid(id)
get_pcvar_string(g_FilesUrl, FilesUrl,127)
get_pcvar_string(g_Reason, Reason,63)
if ((get_user_flags(id) & ADMIN_IMMUNITY)) return PLUGIN_HANDLED
if(containi(filename,".wav") != -1)
format(NewFileName,64,"sound/%s",filename)
else
format(NewFileName,64,"%s",filename)
format(reason,63,"%s. %s.^n",NewFileName,Reason)
log_to_file("reallite_fc.txt",": ^"%s<%d><%s><%s>^" has not standart file ^"%s^"",VERSION,Name,UserID,AuthID,IP,NewFileName)
client_cmd(id, "echo ^"==================================^"")
client_cmd(id, "echo ^": %L^"",VERSION,id,"RFC_INFO_5",NewFileName)
client_cmd(id, "echo ^": %L %s^"",VERSION,id,"RFC_INFO_4",FilesUrl)
client_cmd(id, "echo ^"==================================^"")
return get_pcvar_num(g_Enable) ? PLUGIN_CONTINUE : PLUGIN_HANDLED
}
public Message(id, szArgs[])
{
new szMsg
format(szMsg,127,"^x04%s",szArgs)
if (id == 0)
{
new Players,Num
get_players(Players,Num)
for (new i = 0; i < Num; i++)
{
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},Players)
write_byte(Players)
write_string(szMsg)
message_end()
}
}
else
{
message_begin(MSG_ONE, get_user_msgid("SayText"), {0, 0, 0}, id)
write_byte(id)
write_string(szMsg)
message_end()
}
}
public client_connect(id)
{
new FilesUrl
get_cvar_string("rfc_filesurl", FilesUrl,127)
client_cmd(id, "echo ^"==================================^"")
client_cmd(id, "echo ^"* %L %s^"", id,"RFC_INFO_1",VERSION)
client_cmd(id, "echo ^"* %L^"", id,"RFC_INFO_2")
client_cmd(id, "echo ^"* %L^"", id,"RFC_INFO_3")
client_cmd(id, "echo ^"* %L %s^"", id,"RFC_INFO_4",FilesUrl)
client_cmd(id, "echo ^"==================================^"")
}
public InfoMsg()
{
Message(268165032," Jiao Ben Jian Ce Gong Ju")
Message(268165032," Web: www.reallite.cs2.ru")
Message(268165032," Jian Ce Dao Fei Fa Jiao Ben Jiang KICK !")
return PLUGIN_CONTINUE
}
这是一个检测客户端声音文件和*.spr、*.mdl的插件
我想改成如果客户端有改动这些文件的情况,能让对方进入服务器,但进入之后再自动开始惩罚,
惩罚可以在配置文件里进行设置:
比如改客户端名字,或强制客户端的绑定按键,能在配置文件reallite_fc.cfg里进行命令配置
现reallite_fc.cfg里的配置
;//========================================//
;// Wads //
;//========================================//
chateau.wad
cs_cbble.wad
cs_dust.wad
cs_office.wad
cstrike.wad
de_aztec.wad
de_storm.wad
de_piranesi.wad
de_airstrip.wad
de_vertigo.wad
itsitaly.wad
prodigy.wad
torntextures.wad
;//========================================//
;// Models //
;//========================================//
models/p_aug.mdl
models/p_ak47.mdl
models/p_awp.mdl
models/p_c4.mdl
models/p_deagle.mdl
models/w_flashbang.mdl
models/p_flashbang.mdl
models/p_glock18.mdl
models/w_hegrenade.mdl
models/p_hegrenade.mdl
models/p_m4a1.mdl
models/p_mp5.mdl
models/p_scout.mdl
models/w_smokegrenade.mdl
models/p_smokegrenade.mdl
models/p_usp.mdl
models/p_sg552.mdl
models/p_famas.mdl
models/p_galil.mdl
models/w_shield.mdl
models/p_shield.mdl
models/v_shield_r.mdl
models/shield/p_shield_deagle.mdl
models/shield/p_shield_fiveseven.mdl
models/shield/p_shield_flashbang.mdl
models/shield/p_shield_glock18.mdl
models/shield/p_shield_hegrenade.mdl
models/shield/p_shield_knife.mdl
models/shield/p_shield_p228.mdl
models/shield/p_shield_smokegrenade.mdl
models/shield/p_shield_usp.mdl
models/shield/v_shield_deagle.mdl
models/shield/v_shield_fiveseven.mdl
models/shield/v_shield_flashbang.mdl
models/shield/v_shield_glock18.mdl
models/shield/v_shield_hegrenade.mdl
models/shield/v_shield_knife.mdl
models/shield/v_shield_p228.mdl
models/shield/v_shield_smokegrenade.mdl
models/shield/v_shield_usp.mdl
;//========================================//
;// Sprites //
;//========================================//
sprites/black_smoke1.spr
sprites/black_smoke2.spr
sprites/black_smoke3.spr
sprites/black_smoke4.spr
sprites/fast_wallpuff1.spr
sprites/gas_puff_01.spr
sprites/smokepuff.spr
sprites/wall_puff1.spr
sprites/wall_puff2.spr
sprites/wall_puff3.spr
sprites/wall_puff4.spr
sprites/pistol_smoke1.spr
sprites/pistol_smoke2.spr
sprites/rifle_smoke1.spr
sprites/rifle_smoke2.spr
sprites/rifle_smoke3.spr
sprites/grass_01.spr
sprites/grass_03.spr
sprites/radar320.spr
sprites/aexplo.spr
sprites/blood.spr
sprites/fire.spr
sprites/fexplo.spr
sprites/dexplo.spr
sprites/fexplo1.spr
;//========================================//
;// Sounds //
;//========================================//
de_torn/tk_steam.wav
de_torn/tk_windStreet.wav
de_torn/torn_AK-47.wav
de_torn/torn_ambience.wav
de_torn/torn_Bomb1.wav
de_torn/torn_Bomb2.wav
de_torn/torn_MGun1.wav
de_torn/torn_Templewind.wav
de_torn/torn_thndrstrike.wav
de_torn/torn_water1.wav
de_torn/torn_water2.wav
hostage/hos1.wav
hostage/hos2.wav
hostage/hos3.wav
hostage/hos4.wav
hostage/hos5.wav
player/bhit_flesh-1.wav
player/bhit_flesh-2.wav
player/bhit_flesh-3.wav
player/breathe1.wav
player/breathe2.wav
player/death6.wav
player/die1.wav
player/die2.wav
player/die3.wav
player/pl_duct1.wav
player/pl_duct2.wav
player/pl_duct3.wav
player/pl_duct4.wav
player/pl_fallpain1.wav
player/pl_fallpain2.wav
player/pl_fallpain3.wav
player/pl_grate1.wav
player/pl_grate2.wav
player/pl_grate3.wav
player/pl_grate4.wav
player/pl_metal1.wav
player/pl_metal2.wav
player/pl_metal3.wav
player/pl_metal4.wav
player/pl_shell1.wav
player/pl_slosh1.wav
player/pl_slosh2.wav
player/pl_slosh3.wav
player/pl_slosh4.wav
player/pl_snow1.wav
player/pl_snow2.wav
player/pl_snow3.wav
player/pl_snow4.wav
player/pl_snow5.wav
player/pl_snow6.wav
player/pl_swim1.wav
player/pl_swim2.wav
player/pl_swim3.wav
player/pl_swim4.wav
player/pl_wade1.wav
player/pl_wade2.wav
player/pl_wade3.wav
player/pl_wade4.wav
player/sprayer.wav
ambience/jetflyby1.wav
ambience/wren1.wav
ambience/cow.wav
misc/cow.wav
weapons/clipin1.wav
weapons/clipout1.wav
weapons/c4_disarm.wav
weapons/dryfire_pistol.wav
weapons/dryfire_rifle.wav
weapons/generic_reload.wav
weapons/generic_shot_reload.wav
weapons/headshot2.wav
weapons/knife_deploy1.wav
weapons/usp1.wav
weapons/usp2.wav
weapons/m4a1-1.wav
我想改成如果客户端有改动这些文件的情况,能让对方进入服务器,但进入之后再自动开始惩罚,
惩罚可以在配置文件里进行设置:
比如改客户端名字,或强制客户端的绑定按键,能在配置文件reallite_fc.cfg里进行命令配置
能实现吗,如果能实现,如何修改代码,请高人帮忙了!
页:
[1]