搜索
查看: 3092|回复: 5

管理们进来看看

[复制链接]
发表于 2014-12-8 15:06:43 | 显示全部楼层 |阅读模式 来自 河北秦皇岛
编译不成功显示错误
[mw_shl_code=pawn,true]#include <amxmodx>
#include <cstrike>

new g_kills[33]        //每人杀人记数

public plugin_init(){
        register_plugin("kills","1.0", "A.MI")
        register_event("DeathMsg", "death_kills", "a")
        register_logevent("newRound", 2, "0=World triggered", "1=Round_Start")        // 回合
        register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
}

public client_connect(id){
        g_kills[id] = 0
        return PLUGIN_CONTINUE
}

public client_disconnect(id){
        g_kills[id] = 0
        return PLUGIN_CONTINUE
}

public newRound(){
        new maxppl = get_maxplayers()
        for(new i=0; i<= maxppl; ++i){
                if( is_user_connected(i) )g_kills = 0
        }
}

public death_kills(){
        new killer = read_data(1)
        if( is_user_connected(killer) ){
                                g_kills[killer]++
        }
        return PLUGIN_CONTINUE
}

public end_round(){
    new twho = 0, tnub = 0, tkills
    new maxppl = get_maxplayers()
    for(new i=0; i<= maxppl; ++i){
            if( is_user_connected(i)&& get_user_team(i)==1 ){
                    tkills = g_kills
                    if( tkills > tnub ){
                         tnub = tkills
                          twho = i
                    }
            }
    }
    if( twho ){
            new name[32], newmony = 1000*tnub
            get_user_name(twho,name,31)
            cs_set_user_money( twho, (cs_get_user_money(twho) + newmony) );
            client_print(0,print_chat,"* 本局徒匪杀人最多者: %s .共 %d 人,奖励 %d .",name,tnub,newmony)
    }
    set_task(0.5,"REFBXX");
    return
}

public REFBXX(){
    new ctwho = 0, ctnub = 0, ctkills
    new maxppl = get_maxplayers()
    for(new i=0; i<= maxppl; ++i){
            if( is_user_connected(i)&& get_user_team(i)==2 ){
                    ctkills = g_kills
                    if( ctkills > ctnub ){
                            ctnub = ctkills
                            ctwho = i
                    }
            }
    }
    if( ctwho ){
            new iname[32], ctnewmony = 1000*ctnub
            get_user_name(ctwho,iname,31)
            cs_set_user_money( ctwho, (cs_get_user_money(ctwho) + ctnewmony) );
            client_print(0,print_chat,"* 本局警察杀人最多者: %s .共 %d 人,奖励 %d .",iname,ctnub,ctnewmony)
    }
    return
}[/mw_shl_code]
发表于 2014-12-8 15:11:01 | 显示全部楼层 来自 广东深圳
[mw_shl_code=pawn,true]#include <amxmodx>
#include <cstrike>

new g_kills[33]        //每人杀人记数

public plugin_init()
{
        register_plugin("kills","1.0", "A.MI")
        register_event("DeathMsg", "death_kills", "a")
        register_logevent("newRound", 2, "0=World triggered", "1=Round_Start")        // 回合
        register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
}

public client_connect(id)
{
        g_kills[id] = 0
        return PLUGIN_CONTINUE
}

public client_disconnect(id)
{
        g_kills[id] = 0
        return PLUGIN_CONTINUE
}

public newRound()
{
        new maxppl = get_maxplayers()
        for(new i=1; i<= maxppl; ++i)
        {
                if( is_user_connected(i))
                        g_kills = 0
        }
}

public death_kills()
{
        new killer = read_data(1)
        if(is_user_connected(killer))
        {
                g_kills[killer]++
        }
        return PLUGIN_CONTINUE
}

public end_round()
{
    new twho = 0, tnub = 0, tkills
    new maxppl = get_maxplayers()
    for(new i=0; i<= maxppl; ++i)
    {
            if(is_user_connected(i)&& get_user_team(i)==1)
            {
                    tkills = g_kills
                    if( tkills > tnub )
                    {
                                tnub = tkills
                                twho = i
                    }
            }
    }
   
    if( twho )
    {
            new name[32], newmony = 1000*tnub
            get_user_name(twho,name,31)
            cs_set_user_money( twho, (cs_get_user_money(twho) + newmony) );
            client_print(0,print_chat,"* 本局徒匪杀人最多者: %s .共 %d 人,奖励 %d .",name,tnub,newmony)
    }
    set_task(0.5,"REFBXX");
    return
}

public REFBXX()
{
    new ctwho = 0, ctnub = 0, ctkills
    new maxppl = get_maxplayers()
    for(new i=0; i<= maxppl; ++i)
    {
            if( is_user_connected(i)&& get_user_team(i)==2 )
            {
                    ctkills = g_kills
                    if( ctkills > ctnub )
                    {
                            ctnub = ctkills
                            ctwho = i
                    }
            }
    }
    if( ctwho )
    {
            new iname[32], ctnewmony = 1000*ctnub
            get_user_name(ctwho,iname,31)
            cs_set_user_money( ctwho, (cs_get_user_money(ctwho) + ctnewmony) );
            client_print(0,print_chat,"* 本局警察杀人最多者: %s .共 %d 人,奖励 %d .",iname,ctnub,ctnewmony)
    }
    return
}[/mw_shl_code]
回复

使用道具 举报

 楼主| 发表于 2014-12-8 15:15:41 | 显示全部楼层 来自 河北秦皇岛
龟哥谢了
回复

使用道具 举报

发表于 2014-12-9 16:44:01 | 显示全部楼层 来自 贵州黔西南州
{:4_139:}
加了表情
加了代码框

回复

使用道具 举报

发表于 2015-8-14 14:23:31 | 显示全部楼层 来自 四川
{:4_132:}表情还不错!
回复

使用道具 举报

发表于 2017-3-7 12:13:54 | 显示全部楼层 来自 广东深圳
编译失败,不知道是不是编译版本问题
回复

使用道具 举报

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

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