搜索
查看: 1901|回复: 4

求:定时自动KICK成绩最差的人for amxx

[复制链接]
发表于 2004-8-7 16:28:41 | 显示全部楼层 |阅读模式 来自 中国–浙江–宁波–余姚市
不知道这样的插件有没有?
发表于 2004-8-7 17:09:54 | 显示全部楼层 来自 中国–湖北–襄阳–襄州区
有道是有,不过是amx的....
回复

使用道具 举报

 楼主| 发表于 2004-8-7 18:15:09 | 显示全部楼层 来自 中国–浙江–宁波–余姚市
呵呵 谢谢 找到了 自己编译了个 FOR AMXX的 000的0.2版
回复

使用道具 举报

发表于 2004-8-7 21:33:29 | 显示全部楼层 来自 中国–湖北–襄阳
共享一下,最好有源码好汉化
回复

使用道具 举报

 楼主| 发表于 2004-8-7 21:39:20 | 显示全部楼层 来自 中国–浙江–宁波–余姚市
源码
+++++++++++++++++++++++++++++++++++++++++++
/* 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[maxnum][20]
        new grade[maxnum] = {0, ...}
        new userid[maxnum] = {0, ...}
        new i, tmp, strtmp[20]
        new players[32], 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[0] > grade ) {
                                tmp = grade[0]
                                grade[0] = grade
                                grade = tmp
                                strtmp = username[0]
                                username[0] = username
                                username = strtmp
                                tmp = userid[0]
                                userid[0] = userid
                                userid = tmp
                                tmp = players[0]
                                players[0] = players
                                players = tmp
                        }
                }
                for (i = 2; i < maxnum; i++) {
                        if ( grade[1] > grade ) {
                                tmp = grade[1]
                                grade[1] = grade
                                grade = tmp
                                strtmp = username[1]
                                username[1] = username
                                username = strtmp
                                tmp = userid[1]
                                userid[1] = userid
                                userid = tmp
                                tmp = players[1]
                                players[1] = players
                                players = tmp
                        }
                }
                client_print(0,print_chat,"^"%s^" , ^"%s^" are too bad and will be auto kicked!", username[0],username[1])
                client_print(0,print_chat,"^"%s^" , ^"%s^" are too bad and will be auto kicked!", username[0],username[1])
                client_cmd(players[0],"echo u are too bad and auto kicked by server !")
                client_cmd(players[0],"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[0],get_user_frags(players[0]),get_user_deaths(players[0]),grade[0])
               
                server_cmd("kick #%d", userid[0])
                client_cmd(players[1],"echo u are too bad and auto kicked by server !")
                client_cmd(players[1],"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[1],get_user_frags(players[1]),get_user_deaths(players[1]),grade[1])
                server_cmd("kick #%d", userid[1])
        }
        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文自己动手一下吧 :] 我还在测试。。。
回复

使用道具 举报

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

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