hi guys
i made a small plugin which block change map when rounds didn't reach 14.
but it's not works
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Ayman Khaled"
new CurrentRound
new g_szAllowedRounds, p_AllowedRounds
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("amx_map", "cmdMap")
register_clcmd("amx_votemap", "cmdMap")
g_szAllowedRounds = register_cvar("change_map_rounds", "14")
p_AllowedRounds = get_pcvar_num(g_szAllowedRounds)
register_logevent("Hook_NewR", 2, "1=Round_Start" );
register_event("TextMsg", "Hook_Restart", "a", "2&#Game_C", "2&#Game_w", "2&#Game_will_restart_in" );
}
public Hook_NewR()
{
CurrentRound++
}
public Hook_Restart()
{
CurrentRound=0;
}
public cmdMap(id)
{
if(CurrentRound < p_AllowedRounds)
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}
__________________