求:定时自动KICK成绩最差的人for amxx
不知道这样的插件有没有? 有道是有,不过是amx的.... 呵呵 谢谢 找到了 自己编译了个 FOR AMXX的 000的0.2版 共享一下,最好有源码好汉化 源码+++++++++++++++++++++++++++++++++++++++++++
/* AMX Mod script.
*
* 当服务器人满时,在换下一幅地图前一分钟KICK掉打的最
* 差(frags - deaths)的两个player.
*
* (c) 2003, .o0
*
* This file is provided as is (no warranties).
*
*/
#include <amxmod>
#define maxnum 20
new g_logFile[] = "AutoKick.log"
public AutoKickWorstPlayer() {
new username
new grade = {0, ...}
new userid = {0, ...}
new i, tmp, strtmp
new players, inum
get_players(players,inum)
if ( get_playersnum() >= maxnum ) {
for ( i = 0; i < maxnum; i++ ) {
grade = get_user_frags(players) - get_user_deaths(players)
get_user_name(players, username,20)
userid = get_user_userid(players)
}
for ( i = 1; i < maxnum; i++) {
if ( grade > grade ) {
tmp = grade
grade = grade
grade = tmp
strtmp = username
username = username
username = strtmp
tmp = userid
userid = userid
userid = tmp
tmp = players
players = players
players = tmp
}
}
for (i = 2; i < maxnum; i++) {
if ( grade > grade ) {
tmp = grade
grade = grade
grade = tmp
strtmp = username
username = username
username = strtmp
tmp = userid
userid = userid
userid = tmp
tmp = players
players = players
players = tmp
}
}
client_print(0,print_chat,"^"%s^" , ^"%s^" are too bad and will be auto kicked!", username,username)
client_print(0,print_chat,"^"%s^" , ^"%s^" are too bad and will be auto kicked!", username,username)
client_cmd(players,"echo u are too bad and auto kicked by server !")
client_cmd(players,"echo u are too bad and auto kicked by server !")
log_to_file(g_logFile," ^"%s^" is kicked , frags = %d , deaths = %d , C = %d",username,get_user_frags(players),get_user_deaths(players),grade)
server_cmd("kick #%d", userid)
client_cmd(players,"echo u are too bad and auto kicked by server !")
client_cmd(players,"echo u are too bad and auto kicked by server !")
log_to_file(g_logFile," ^"%s^" is kicked , frags = %d , deaths = %d , C = %d",username,get_user_frags(players),get_user_deaths(players),grade)
server_cmd("kick #%d", userid)
}
else if ( inum > 0 ) {
log_to_file(g_logFile," Total : %d players",inum)
}
}
public plugin_init(){
register_plugin("Kick The Worst", "0.2", ".o0")
set_task(30.0,"AutoKickWorstPlayer", 0, "", 0, "d")
return PLUGIN_CONTINUE
}
两行E文自己动手一下吧 :] 我还在测试。。。
页:
[1]