/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define SUPERADMIN ADMIN_LEVEL_H
new g_iTeamScore[2];
new bool:g_bAllowMapChange;
public plugin_init( ) {
register_plugin( "Limit <changelevel>", "1.0", "Shadowless" );
register_event("TeamScore", "Event_TeamScore", "a");
register_clcmd("amx_map", "limitchangelevel");
register_clcmd("amx_votemap", "limitchangelevel");
register_clcmd("amx_mapmenu", "limitchangelevel");
register_clcmd("amx_votemapmenu", "limitchangelevel");
register_clcmd("changelevel", "limitchangelevel");
register_concmd("amx_map", "limitchangelevel", ADMIN_MAP, "<mapname>" );
register_concmd("amx_votemap", "limitchangelevel", ADMIN_VOTE, "- displays votemap menu" );
register_concmd("amx_mapmenu", "limitchangelevel", ADMIN_MAP, "- displays changelevel menu" );
register_concmd("amx_votemapmenu", "limitchangelevel", ADMIN_VOTE, "- displays votemap menu" );
register_concmd("changelevel", "limitchangelevel", ADMIN_MAP, "Limit <changelevel>" );
register_srvcmd("amx_map","limitchangelevel");
register_srvcmd("amx_votemap","limitchangelevel");
register_srvcmd("amx_mapmenu", "limitchangelevel");
register_srvcmd("amx_votemapmenu","limitchangelevel");
register_srvcmd("amx_votemapmenu","limitchangelevel");
register_srvcmd("changelevel","limitchangelevel");
}
public Event_TeamScore()
{
new team[2]; read_data(1, team, charsmax(team));
g_iTeamScore[(team[0]=='C') ? 0 : 1] = read_data(2);
g_bAllowMapChange = (g_iTeamScore[0] + g_iTeamScore[1]) > 15;
}
public limitchangelevel(id)
{
if(!g_bAllowMapChange && get_user_flags(id) & SUPERADMIN) return PLUGIN_CONTINUE;
if(!g_bAllowMapChange)
{
console_print(id,"Notice: Map Change Allowed After 15 Rounds")
client_print(0,print_chat,"Notice: Map Change Allowed After 15 Rounds")
return PLUGIN_HANDLED;
}
if(g_bAllowMapChange) return PLUGIN_CONTINUE;
else
{
console_print(id,"Notice: Map Change Allowed After 15 Rounds")
client_print(0,print_chat,"Notice: Map Change Allowed After 15 Rounds")
}
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/