搜索
查看: 1836|回复: 1

【技术交流】如何设置statsx.amxx让/rank和/top15等等是网页风格显示的

[复制链接]
发表于 2005-3-7 10:43:56 | 显示全部楼层 |阅读模式 来自 中国–湖北–武汉
如何设置statsx.amxx让/rank和/top15等等是网页风格显示的
深圳一网老大,不好意思了,借用你的代码了 :super:
--------------------------------------------------------------------------------

如何设置statsx.amxx让/rank和/top15是网页风格显示的,就是有框框的那种,有谁可以提供下载,我用的是amxx1.0的【cs1.5和cs1.6的服务器我都有】
在此谢谢了
还有:
附上:每整点将amxX的排行榜转换成中文htm文件源代码:
希望有那个好心人改好了上传到这里

#include <amxmodx>
#include <amxmisc>
#include <csstats>


new g_Buffer[2048]
new g_fileToSavehtm[64]

public plugin_init() {

register_plugin("CS Stats-html","0.16","Kindzhon.126.com")
register_cvar("amx_csstatshtm","addons/amxx/custom/csstats")
set_task(60.0,"htm",0,"",0,"b")
}

public htm() {
new mmins[6]
get_time("%M",mmins,5)
new mins = str_to_num(mmins)
get_cvar_string("amx_csstatshtm",g_fileToSavehtm,63)
format(g_fileToSavehtm, 63, "%s.htm",g_fileToSavehtm)
if (mins == 0) writehtm(g_fileToSavehtm)
return PLUGIN_CONTINUE
}

writehtm(filename[]) {
new pos, stats[8], body[8], name[32]
new state[4]
if (file_exists(filename)) delete_file(filename)
pos = copy(g_Buffer,2047,"<html><head><body><table><tr><td bgcolor=#0000FF align=center>一网情深反恐精英站排行榜</td></tr></table></body>")
pos += copy(g_Buffer[pos],2047-pos,"<body><style type=^"text/css^">")
pos += copy(g_Buffer[pos],2047-pos,"body{font-family:Arial,sans-serif;font-size:12px;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}.header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}")
pos += copy(g_Buffer[pos],2047-pos,"</style></head><body><table><tr class=^"header^"><td>名次</td><td>用户名</td><td>杀死</td><td>被杀</td><td>击中</td><td>开枪</td><td>爆头</td></tr>")
write_file(filename,g_Buffer)
new imax = get_statsnum()
for(new a = 0; a < imax; ++a){
if (equal(state,"one")) copy(state,3,"two")
else copy(state,3,"one")
get_stats(a,stats,body,name,31)
format(g_Buffer,2047,"<tr class=^"%s^"><td>%d.</td><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>",state,a+1,name,stats[0],stats[1],stats[5],stats[4],stats[2])
write_file(filename,g_Buffer)
/* client_print(0,print_chat,"rank %d ", a)
*/
}
new ctime[64]
get_time("%Y年%m月%d日- %H:%M:%S",ctime,63)
format(g_Buffer,2047,"</table><body><table><tr><td bgcolor=#00007F align=center>本次更新时间为%s</td></tr></table></body></body></html>",ctime)
write_file(filename,g_Buffer)

}
 楼主| 发表于 2005-3-7 10:45:40 | 显示全部楼层 来自 中国–湖北–武汉
怎么没人回复?
哦,今天是星期一
:too_sad:  :cry:
回复

使用道具 举报

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

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