|
楼主 |
发表于 2009-1-9 22:55:42
|
显示全部楼层
来自 中国–河南–商丘
本帖最后由 laolang 于 2009-1-10 14:48 编辑
1# laolang
刚看到有个朋友提供了FilesCheck.sma原码,谢谢
我把FilesCheck.sma发上,看看大家能不 能修改下,如果修改好了,就能封内挂- /* AMX Mod X Plugin
- *
- * (c) Copyright 2008, ConnorMcLeod
- * This file is provided as is (no warranties).
- *
- */
- #include <amxmodx>
- new g_pcvarExactModel, g_pcvarSeparateLogFile
- public plugin_init()
- {
- static const VERSION[] = "1.1"
- register_plugin("Files Check", VERSION, "Greenboy")
- register_cvar("fc_version", VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
- g_pcvarSeparateLogFile = register_cvar("fc_separatelog", "2")
- }
- public plugin_precache()
- {
- g_pcvarExactModel = register_cvar("fc_exactweapons", "0")
- static szConfigFile[64]
- get_localinfo("amxx_configsdir", szConfigFile, 63)
- format(szConfigFile, 63, "%s/filescheck.ini", szConfigFile)
- new File = fopen(szConfigFile, "rt")
- if(!File)
- return
- static szFile[64]
- while(!feof(File))
- {
- fgets(File, szFile, 63)
- trim( szFile )
- if(!szFile[0] || szFile[0] == ';' || (szFile[0] == '/' && szFile[1] == '/'))
- continue
- if (!file_exists(szFile))
- continue
- if(equali(szFile[strlen(szFile)-4], ".mdl"))
- {
- force_unmodified(get_pcvar_float(g_pcvarExactModel) ? force_exactfile : force_model_samebounds, {0,0,0}, {0,0,0}, szFile)
- }
- else
- {
- force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, szFile)
- }
- }
- fclose(File)
- }
- public inconsistent_file(id, const filename[], reason[64])
- {
- static szMessage[192], szName[32], UserID, IP[32], szAuthid[32]
- get_user_name(id, szName, 31)
- get_user_ip(id,IP,31)
- get_user_authid(id, szAuthid, 31)
- UserID = get_user_userid(id)
- formatex(szMessage, 191, "^"%s<%s>^" 浣跨敤浜嗛潪娉曟枃浠?^"%s^"", szName, IP, filename)
- switch( get_pcvar_num(g_pcvarSeparateLogFile) )
- {
- case 1:
- {
- log_amx(szMessage)
- }
- case 2:
- {
- static const szLogFile[] = "filecheck.log"
- log_to_file(szLogFile, szMessage)
- }
- default:
- {
- log_message(szMessage)
- }
- }
- server_cmd("say ^"%s^"", szMessage)
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ ansicpg936\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
- */
复制代码 |
|