 |
|
Member
|

01-27-2013
, 13:12
Re: Rotate server_cmd()
|
#2
|
Quote:
Originally Posted by chungsy
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "exec cfg"
#define VERSION "1.0"
#define AUTHOR "fysiks!"
#define LOADING "^n^t%s v%s, Copyright (C) 2013 by %s^n"
new g_iCounter = 0
new g_szCfgs[][] = {
"cfg_one.cfg",
"cfg_two.cfg"
}
public plugin_init()
{
register_plugin("PLUGIN", "VERSION", "AUTHOR");
server_print("LOADING", "PLUGIN", "VERSION", "AUTHOR");
set_task(30.0, "myTask", .repeat=1)
}
public myTask()
{
server_cmd("exec %s", g_szCfgs[g_iCounter % sizeof(g_szCfgs)])
g_iCounter++
}
The code doesn't work for some reason. If the one above works, thats good, but what if I want to exec the first cfg for 30s and the 2nd one for 10s? Can you make it more flexible?
|
Posted already. I want to change a plugin Cvar.
Last edited by chungsy; 01-27-2013 at 13:19.
|
|
|
|