搜索
查看: 5932|回复: 7

关于反作弊插件Reallite_Files_Checker的问题

[复制链接]
发表于 2008-7-12 00:29:32 | 显示全部楼层 |阅读模式 来自 中国–天津–天津
#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[64], ChecksFile[96]
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[64]
new a, Position = 0
while (read_file(ChecksFile,Position++,RFC_Text,63,a))
{
if (RFC_Text[0] != ';' && !equal(RFC_Text,""))
Enforce (RFC_Text)
}
}
}
public File_Precache(const File[])
{
Enforce (File)

return FMRES_IGNORED
}
public Enforce(const File[])
{
new FileWav[64]
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[64])
{
new Name[32], AuthID[32], IP[32], UserID, FilesUrl[128], NewFileName[64], Reason[64]
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","[Reallite Files Checker %s]: ^"%s<%d><%s><%s>^" has not standart file ^"%s^"",VERSION,Name,UserID,AuthID,IP,NewFileName)
client_cmd(id, "echo ^"==================================^"")
client_cmd(id, "echo ^"[Reallite Files Checker %s]: %L^"",VERSION,id,"RFC_INFO_5",NewFileName)
client_cmd(id, "echo ^"[Reallite Files Checker %s]: %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[128]
format(szMsg,127,"^x04%s",szArgs)

if (id == 0)
{
new Players[32],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[128]
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,"[MY] Jiao Ben Jian Ce Gong Ju")
Message(268165032,"[MY] Web: www.reallite.cs2.ru")
Message(268165032,"[MY] 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里进行命令配置


能实现吗,如果能实现,如何修改代码,请高人帮忙了!
发表于 2008-7-14 17:05:12 | 显示全部楼层 来自 中国–广东–佛山

回复: 关于反作弊插件Reallite_Files_Checker的问题

汗,为什么不检测voice_speex.dll等文件呢?
回复

使用道具 举报

发表于 2008-8-29 10:39:57 | 显示全部楼层 来自 中国–黑龙江–哈尔滨

回复: 关于反作弊插件Reallite_Files_Checker的问题

。。。。。。。。。。。。。。。。。。
回复

使用道具 举报

发表于 2008-9-4 01:37:22 | 显示全部楼层 来自 中国–安徽–淮南

回复: 关于反作弊插件Reallite_Files_Checker的问题

检测那么多文件做什么.........................................
回复

使用道具 举报

发表于 2010-5-21 05:03:50 | 显示全部楼层 来自 中国–福建–泉州
这个不行的吧
回复

使用道具 举报

发表于 2010-5-23 13:55:50 | 显示全部楼层 来自 中国–北京–北京
永远支持反作弊!
回复

使用道具 举报

发表于 2011-7-26 17:21:27 | 显示全部楼层 来自 中国–黑龙江–大兴安岭地区
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2011-8-7 20:37:13 | 显示全部楼层 来自 中国–辽宁–沈阳–大东区
把源码文件发上来被 谢谢............
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表