Raised This Month: $ Target: $400
 0% 

Rotate server_cmd()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
chungsy
Member
Join Date: Nov 2011
Old 01-27-2013 , 13:12   Re: Rotate server_cmd()
Reply With Quote #10

Quote:
Originally Posted by chungsy View Post
#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.
chungsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode