- 听众
- 收听
- 积分
- 90
- 主题
- 回帖
- 0
- 精华
注册时间2008-11-24
最后登录1970-1-1
该用户从未签到
|
怎么不能上传附件啊,只能发源代码
下面是我在国外论坛上找的能显示前100名的插件,
拿过来研究一下,看看怎么用:
/* AMX Mod X
* csstats Rank to .htm Plugin
*
* originally developed by Kindzhon from China
*
* This cs-htm.amx can convert csstats Rank to *.htm per hour, like 1:00,2:00,3:00.......
*
* And you can set "amx_csstatshtm dir&filename " in server.cfg ,just as:
* amx_csstatshtm "addons/amxx/custom/csstats27015"
* amx_csstatshtm "../../bbs/csstats27016"
* default dir&filename is "addons/amxx/custom/csstats27015.htm"
*
* Usage: amx_csstatshtm "dir&filename"
*
* My web: http://61.144.228.61
* http://kindzhon.126.com
* Email:kindzhon@szonline.net
*/
#include <amxmodx>
#include <amxmisc>
#include <csx>
new g_Buffer[2048]
new g_fileToSavehtm[64]
public plugin_init()
{
register_plugin("CS Stats-html", "0.16", "Kindzhon.126.com")
new szConfig[64]
get_configsdir(szConfig, 63)
add(szConfig, 63, "/csstats")
register_cvar("amx_csstatshtm", szConfig)
set_task(60.0, "htm", _, _, _, "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
new stats[8]
new body[8]
new name[32]
new states[4]
if(file_exists(filename))
delete_file(filename)
pos = copy(g_Buffer,2047,"<html><head><body><table><tr><td bgcolor=#0000FF align=center>Kindzhon.126.com Rank List</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>Rank</td><td>name</td><td>Kills</td><td>Death</td><td>hits</td><td>Shots</td><td>Headshots</td></tr>")
write_file(filename,g_Buffer)
new imax = get_statsnum()
for(new a = 0; a < imax; ++a)
{
copy(states, 3, "one")
if (equal(states,"one"))
copy(states,3,"two")
else
copy(states,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>",states,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("%m.%d.%Y- %H:%M:%S", ctime, 63)
format(g_Buffer, 2047, "</table><body><table><tr><td bgcolor=#00007F align=center>Update time: %s</td></tr></table></body></body></html>", ctime)
write_file(filename,g_Buffer)
} |
|