yanexp 发表于 2004-10-5 18:38:59

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

源代码
/* 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, stimes
        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

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

yanexp 发表于 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, stimes
        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

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

高手去哪了??
页: [1]
查看完整版本: 请问高手admin_restartround.amx能不能改成这样?