same thing, it's not works.
should i add this code to admincmd.amxx in cmdMap(id) or not ?
EDIT:
now it's works in admincmd.sma

if someone is interesting
PHP Code:
const AdminFlags = ( ADMIN_IMMUNITY );
#define IsAdmin(%1) ((get_user_flags(%1)&AdminFlags)==AdminFlags)
new CurrentRound
new g_szAllowedRounds, p_AllowedRounds
in plugin_init
PHP Code:
g_szAllowedRounds = register_cvar("change_map_rounds", "20")
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" );
PHP Code:
public Hook_NewR()
{
CurrentRound++
}
public Hook_Restart()
{
CurrentRound=0;
}
if ( !IsAdmin ( id ) )
here to check if user don't has ADMIN_IMMUNITY then block change map until reach 20 rounds.
PHP Code:
public cmdMap(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
if ( !IsAdmin ( id ) )
{
if(CurrentRound < p_AllowedRounds)
{
client_print(id, print_chat "[NaBlu$-GamING] You are not allowed to change map right now.")
return PLUGIN_HANDLED
}
}
new arg[32]
new arglen = read_argv(1, arg, charsmax(arg))
if (!is_map_valid(arg))
{
console_print(id, "[AMXX] %L", id, "MAP_NOT_FOUND")
return PLUGIN_HANDLED
}
new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name))
show_activity_key("ADMIN_MAP_1", "ADMIN_MAP_2", name, arg);
log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"", name, get_user_userid(id), authid, arg)
new _modName[10]
get_modname(_modName, charsmax(_modName))
if (!equal(_modName, "zp"))
{
message_begin(MSG_ALL, SVC_INTERMISSION)
message_end()
}
set_task(2.0, "chMap", 0, arg, arglen + 1)
return PLUGIN_HANDLED
}
__________________