求一个到一定局数自动刷新的插件
求一个到一定局数自动刷新的插件 可以自己设定多少局刷新 有源码最好啦 #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;
} #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);
} 支持!顶!
页:
[1]