#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN "Reallite Files Checker"
#define VERSION "0.5"
#define AUTHOR "DJ_WEST"
static const s_FilesUrl[] = "www.reallite.cs2.ru"
static const s_Reason[] = "Please use only standart files"
new g_FilesUrl
new g_Reason
new g_Enable
new g_Admin
new g_CheckMaps
new g_CheckTextures
new g_CheckModels
new g_CheckSprites
new g_CheckSound
new g_CheckExe
new g_CheckOpengl32
public plugin_init()
{
new s_ConfigsDir, s_ChecksFile
get_configsdir(s_ConfigsDir, sizeof(s_ConfigsDir)-1)
format (s_ChecksFile, sizeof(s_ChecksFile)-1, "%s/reallite_fc_main.cfg", s_ConfigsDir)
if (file_exists (s_ChecksFile))
server_cmd("exec %s", s_ChecksFile)
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("rfc_version", VERSION, FCVAR_SERVER)
register_dictionary ("reallite_fc.txt")
g_FilesUrl = register_cvar("rfc_filesurl", s_FilesUrl)
g_Reason = register_cvar("rfc_reason", s_Reason)
g_Enable = register_cvar("rfc_enable", "1")
g_Admin = register_cvar("rfc_admin", "1")
g_CheckMaps = register_cvar("rfc_maps", "1")
g_CheckTextures = register_cvar("rfc_textures", "1")
g_CheckModels = register_cvar("rfc_models", "1")
g_CheckSprites = register_cvar("rfc_sprites", "1")
g_CheckSound = register_cvar("rfc_sounds", "1")
g_CheckExe = register_cvar("rfc_exe", "1")
g_CheckOpengl32 = register_cvar("rfc_opengl32", "1")
}
public plugin_precache()
{
register_forward (FM_PrecacheModel, "File_Precache")
register_forward (FM_PrecacheSound, "File_Precache")
register_forward (FM_PrecacheGeneric, "File_Precache")
new s_ConfigsDir, s_ChecksFile
get_configsdir(s_ConfigsDir, sizeof(s_ConfigsDir)-1)
new s_MapName, s_MapFile
get_mapname(s_MapName, sizeof(s_MapName)-1)
format (s_MapFile, sizeof(s_MapFile)-1, "maps/%s.bsp", s_MapName)
Enforce(s_MapFile)
format(s_ChecksFile, sizeof(s_ChecksFile)-1, "%s/reallite_fc.cfg", s_ConfigsDir)
if (!file_exists (s_ChecksFile))
log_amx ("ERROR: %s doesn't exist.", s_ChecksFile)
else
{
new s_RFCText
new a, i_Position = 0
while (read_file(s_ChecksFile, i_Position++, s_RFCText, 63, a))
{
if (s_RFCText != ';' && !equal(s_RFCText, ""))
Enforce(s_RFCText)
}
}
}
public File_Precache(const s_File[])
{
Enforce(s_File)
return FMRES_IGNORED
}
public Enforce(const s_File[])
{
new s_FileWav
format (s_FileWav, sizeof(s_FileWav)-1, "sound/%s", s_File)
if (file_exists(s_File))
force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, s_File)
else if (file_exists(s_FileWav))
force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, s_File)
}
public inconsistent_file(id, const s_FileName[], s_KickReason)
{
new s_Name, s_AuthID, s_IP, i_UserID, s_FilesUrl, s_NewFileName, s_Reason
get_user_authid(id, s_AuthID, sizeof(s_AuthID)-1)
get_user_ip(id, s_IP, sizeof(s_IP)-1)
get_user_name(id, s_Name, sizeof(s_Name)-1)
i_UserID = get_user_userid(id)
get_pcvar_string(g_FilesUrl, s_FilesUrl, sizeof(s_FilesUrl)-1)
get_pcvar_string(g_Reason, s_Reason, sizeof(s_Reason)-1)
if (!(get_pcvar_num(g_Admin) == 1))
if ((get_user_flags(id) & ADMIN_IMMUNITY)) return PLUGIN_HANDLED
if (!(get_pcvar_num(g_CheckMaps) == 1) && (containi(s_FileName, ".bsp") != -1))
return PLUGIN_HANDLED
if (!(get_pcvar_num(g_CheckTextures) == 1) && (containi(s_FileName, ".wad") != -1))
return PLUGIN_HANDLED
if (!(get_pcvar_num(g_CheckModels) == 1) && (containi(s_FileName, ".mdl") != -1))
return PLUGIN_HANDLED
if (!(get_pcvar_num(g_CheckSprites) == 1) && (containi(s_FileName, ".spr") != -1))
return PLUGIN_HANDLED
if (!(get_pcvar_num(g_CheckSound) == 1) && (containi(s_FileName, ".wav") != -1))
return PLUGIN_HANDLED
if (!(get_pcvar_num(g_CheckOpengl32) == 1) && (containi(s_FileName, ".dll") != -1))
return PLUGIN_HANDLED
if (!(get_pcvar_num(g_CheckExe) == 1) && (containi(s_FileName, ".exe") != -1))
return PLUGIN_HANDLED
if(containi(s_FileName, ".wav") != -1)
format(s_NewFileName, 64, "sound/%s", s_FileName)
else
format(s_NewFileName, 64, "%s", s_FileName)
format(s_KickReason, sizeof(s_KickReason)-1, "%s. %s.^n", s_NewFileName, s_Reason)
log_to_file("reallite_fc.txt",": ^"%s<%d><%s><%s>^" has not standart file ^"%s^"", VERSION, s_Name, i_UserID, s_AuthID, s_IP, s_NewFileName)
client_cmd(id, "echo ^"==================================^"")
client_cmd(id, "echo ^": %L^"", VERSION, id, "RFC_INFO_5", s_NewFileName)
client_cmd(id, "echo ^": %L %s^"", VERSION, id, "RFC_INFO_4", s_FilesUrl)
client_cmd(id, "echo ^"==================================^"")
Message(s_Name, s_NewFileName)
return get_pcvar_num(g_Enable) ? PLUGIN_CONTINUE : PLUGIN_HANDLED
}
public client_connect(id)
{
new s_FilesUrl
get_cvar_string("rfc_filesurl", s_FilesUrl, sizeof(s_FilesUrl)-1)
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", s_FilesUrl)
client_cmd(id, "echo ^"=======================================================^"")
}
public Message(s_Name[], s_File[])
{
new s_Message, s_Team
format(s_Message, sizeof(s_Message)-1, "^x03Reallite Files Checker %s [ ^x04%s - %s^x03 ]", VERSION, s_Name, s_File)
new s_Players, i_Num
get_players(s_Players, i_Num)
new id
for (id = 0; id < i_Num; id++)
{
get_user_team(s_Players, s_Team, sizeof(s_Team)-1)
message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, s_Players)
write_byte(s_Players)
write_string("TERRORIST")
message_end()
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0},s_Players)
write_byte(s_Players)
write_string(s_Message)
message_end()
message_begin(MSG_ONE, get_user_msgid("TeamInfo"), {0,0,0}, s_Players)
write_byte(s_Players)
write_string(s_Team)
message_end()
}
return PLUGIN_HANDLED
} 10# wangleiwdwd888
我觉得这才是对的 到底怎么办啊? 到底怎么办啊? 正常的情况下,CS目录下是没有这个文件的,所以,当你加上检查/opengl.dll时会出错,估计跟这个有关。 没有这个文件肯定检测不到 所以..进不来 如果能反掉这个就好
页:
1
[2]