搜索
查看: 3391|回复: 1

请问高手admin_restartround.amx能不能改成这样?

[复制链接]
发表于 2004-10-5 18:38:59 | 显示全部楼层 |阅读模式 来自 中国–广东–广州
源代码
/* AMX Mod script.
*
* (c) Copyright 2002-2003, f117bomb
* This file is provided as is (no warranties).
*/

#include <amxmod>
#include <amxmisc>

/*
* amx_rr <restart times> <delay>
*
*/

public drestart(param[])
        set_cvar_string("sv_restart",param)

public admin_rr(id, level, cid) {
        if (!cmd_access(id, level, cid, 3))
                return PLUGIN_HANDLED
        new sdelay[4], stimes[4]
        read_argv(1,stimes,3)
        read_argv(2,sdelay,3)
        new delay = strtonum(sdelay)
        new times = strtonum(stimes)
        for(new a = times;a > 0;--a)
                set_task( float(delay * a) + 1.0 , "drestart", 0, sdelay, 4)
        console_print(id,"The Game will restart %d times with a %d sec. delay between restarts",times,delay)
        return PLUGIN_HANDLED
}

public plugin_init() {
        register_plugin("Admin RestartRound","0.9.2","f117bomb")
        register_concmd("amx_rr","admin_rr",ADMIN_LEVEL_A,"<restart times> <delay>")
        return PLUGIN_CONTINUE
}

因为我这每天都举行一次CS比赛活动

调用 amx_rr 3 1 时只会显示1秒后刷新,相同的显示三次,
能不能改成
3秒后刷新 sv_restart 3
2秒后刷新 sv_restart 2
1秒后刷新 sv_restart 1

玩家知道服务器要刷新几次,这样就更直观了
 楼主| 发表于 2004-10-5 22:35:42 | 显示全部楼层 来自 中国–广东–广州
Post by yanexp
源代码
/* AMX Mod script.
*
* (c) Copyright 2002-2003, f117bomb
* This file is provided as is (no warranties).
*/

#include <amxmod>
#include <amxmisc>

/*
* amx_rr <restart times> <delay>
*
*/

public drestart(param[])
        set_cvar_string("sv_restart",param)

public admin_rr(id, level, cid) {
        if (!cmd_access(id, level, cid, 3))
                return PLUGIN_HANDLED
        new sdelay[4], stimes[4]
        read_argv(1,stimes,3)
        read_argv(2,sdelay,3)
        new delay = strtonum(sdelay)
        new times = strtonum(stimes)
        for(new a = times;a > 0;--a)
                set_task( float(delay * a) + 1.0 , "drestart", 0, sdelay, 4)
        console_print(id,"The Game will restart %d times with a %d sec. delay between restarts",times,delay)
        return PLUGIN_HANDLED
}

public plugin_init() {
        register_plugin("Admin RestartRound","0.9.2","f117bomb")
        register_concmd("amx_rr","admin_rr",ADMIN_LEVEL_A,"<restart times> <delay>")
        return PLUGIN_CONTINUE
}

因为我这每天都举行一次CS比赛活动

调用 amx_rr 3 1 时只会显示1秒后刷新,相同的显示三次,
能不能改成
3秒后刷新 sv_restart 3
2秒后刷新 sv_restart 2
1秒后刷新 sv_restart 1

玩家知道服务器要刷新几次,这样就更直观了


高手去哪了??
回复

使用道具 举报

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

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