q852994999 发表于 2016-2-29 11:42:47

求一个到一定局数自动刷新的插件

求一个到一定局数自动刷新的插件      可以自己设定多少局刷新    有源码最好啦

Rulzy 发表于 2016-2-29 22:05:47

#include <amxmodx>
#include <amxmisc>

new gpMaxRound;
new gScoreT = 0;
new gScoreCT = 0;

public plugin_init()
{
        register_plugin("Auto Restart Round", "1.0", "Rulzy");
       
        register_event("TeamScore", "eTeamScore", "a");
       
        gpMaxRound = register_cvar("amx_maxround", "15");
}

public eTeamScore()
{
        new score = read_data(2);
        new TeamName;
        read_data(1, TeamName, 19);
        if( equali(TeamName, "TERRORIST") )
                gScoreT = score;
        else if( equali(TeamName, "CT") )
                gScoreCT = score;
        else
                return PLUGIN_CONTINUE;
        new maxRound = get_pcvar_num(gpMaxRound);
        if (gScoreT+gScoreCT >= maxRound)
                server_cmd("sv_restart 1");
        return PLUGIN_CONTINUE;
}

Kwrong 发表于 2017-1-22 00:05:02

#include <amxmodx>
#include <amxmisc>

//new ct_score, te_score;

public plugin_init()
{
        register_plugin("score_show", "1.0", "KWf")

        register_event("TeamScore", "save_score", "a")
}

public save_score(id)
{
        new score = read_data(2);        // 获取事件分数
        new teamName;                        // 储存队伍名称的字符容器
        read_data(1, teamName, 28); // 获取事件参数1(队伍名)

        server_print("(%s)队伍获得分数(%d)", teamName, score);
}

tly111222 发表于 2017-1-23 09:47:21

支持!顶!
页: [1]
查看完整版本: 求一个到一定局数自动刷新的插件