Code:
#include <amxmodx>
new votes,bool:switchy;
public plugin_init()
{
register_plugin("NS Combat Extender","1.0","semaja2");
register_clcmd("say","Hook_Say");
register_cvar("amx_extend","1");
register_cvar("amx_extend_votes","5");
set_task(5.0,"check_tl");
}
public Hook_Say(id)
{
if(!get_cvar_num("amx_extend"))
return 0;
new arg[128];
read_argv(1,arg,127);
if(containi(arg,"extend") != -1)
votes++;
client_print(id,print_chat,"You have voted to extend the map.");
return 0;
}
public check_tl()
{
if(!get_cvar_num("amx_extend") || switchy)
return 0;
new timeleft = get_timeleft();
if(timeleft <= 300 && votes >= get_cvar_num("amx_extend_votes"))
{
switchy = true;
// whatever vote stuff
}
return 0;
}
something like that? I still don't get what sv_combattime is. Is it like mp_timeleft, except for co_ maps? Or something?
__________________