Вот кусок скрипта который отвечает за меню и мне в нем нужно преределать доступ к разделу Settings что бы он был доступен не через ADMIN_LEVEL_А а через ADMIN_LEVEL_B. Я сам вставил кусок кода бездумно так как не понеаю не чего, вроде вышло сам плагин работает но вот когда компеляцию провожу выходит ошибка

может она и не на что не влияет но думаю что код не коректный подправте плиз. Сам плагин ниже.
Цитата
// ============================================================================
// ================================= MENU =====================================
// ============================================================================
public war_action_mm(id,key) {
#if defined DEBUG
server_print("* war_action_mm(%d,%d)",id,key)
#endif
switch(key){
case 0:
if((war_live == 0) && (war_live != 5)) war_show_wm(id)
case 1:
if(war_live > 0) war_abort(id)
case 2:
if((war_live != 0) && (war_live%2 > 0) && (war_live != 5)) war_forcestart(id)
case 3:
war_show_sm(id)
}
return PLUGIN_HANDLED
}
public war_show_mm(id) {
#if defined DEBUG
server_print("* war_show_mm(%d)",id)
#endif
if (id && !((get_user_flags(id) & ADMIN_LEVEL_A))) {
war_clienttext("clt_noaccess",id)
return PLUGIN_HANDLED
}
new menu_body[512]
new keys = (1<<9)|(1<<3)
new len = format(menu_body,511,"\yAMX War System^n^n")
if(war_live > 0) {
len += format(menu_body[len],511-len,"\d1. Start a Match^n\w2. Abort current match^n")
keys |= (1<<1)
}
else {
len += format(menu_body[len],511-len,"\w1. Start a Match^n\d2. Abort current match^n")
keys |= (1<<0)
}
if((war_live > 0) && (war_live%2 > 0) && (war_live != 5)) {
len += format(menu_body[len],511-len,"\w3. Autostart current match^n")
keys |= (1<<2)
}
else len += format(menu_body[len],511-len,"\d3. Autostart current match^n")
format(menu_body[len],511-len,"\w4. Settings^n^n0. Exit")
war_loadini()
war_findtags()
show_menu(id,keys,menu_body)
return PLUGIN_HANDLED
}
public war_action_sm(id,key) {
#if defined DEBUG
server_print("* war_action_sm(%d,%d)",id,key)
#endif
new x
new filename[128]
format(filename,127,"%s/amxwar.cfg",cfgdir)
if(sm_page==0)
{
switch(key)
{
case 0: {
x = get_cvar_num("aw_tie")+1
if(x > 1) x = 0
set_cvar_num("aw_tie",x)
war_show_sm(id)
}
case 1: {
x = get_cvar_num("aw_countdowntime");if(x%5==0) x+=5;else while(x %5 !=0) x++
if(x > 30) x = 0
set_cvar_num("aw_countdowntime",x)
war_show_sm(id)
}
case 2: {
x = get_cvar_num("aw_warmup_timelimit");if(x%5==0) x+=5;else while(x %5 !=0) x++
if(x > 30) x = 0
set_cvar_num("aw_warmup_timelimit",x)
war_show_sm(id)
}
case 3: {
x = get_cvar_num("aw_assign_mode")+1
if(x > 2) x = 0
set_cvar_num("aw_assign_mode",x)
war_show_sm(id)
}
case 4: {
x = get_cvar_num("aw_autoteam")+1
if(x > 1) x = 0
set_cvar_num("aw_autoteam",x)
war_show_sm(id)
}
case 5: {
x = get_cvar_num("aw_demos")+1
if(x > 2) x = 0
set_cvar_num("aw_demos",x)
war_show_sm(id)
}
case 6: {
x = get_cvar_num("aw_screenshots")+1
if(x > 2) x = 0
set_cvar_num("aw_screenshots",x)
war_show_sm(id)
}
case 7: {
delete_file(filename)
log_settings(filename)
war_show_sm(id)
}
case 8: {
sm_page++
war_show_sm(id)
}
case 9: war_show_mm(id)
}
}else
if(sm_page==1)
{
switch(key)
{
case 0: {
x = get_cvar_num("aw_onlykillfrags")+1
if(x > 1) x = 0
set_cvar_num("aw_onlykillfrags",x)
war_show_sm(id)
}
case 1: {
x = get_cvar_num("aw_check_ip")+1
if(x > 1) x = 0
set_cvar_num("aw_check_ip",x)
war_show_sm(id)
}
case 2: {
x = get_cvar_num("aw_check_name")+1
if(x > 1) x = 0
set_cvar_num("aw_check_name",x)
war_show_sm(id)
}
case 3: {
x = get_cvar_num("aw_return_money_by")
if(x < 4) x++
else x = 0
set_cvar_num("aw_return_money_by",x)
war_show_sm(id)
}
case 4: {
x = get_cvar_num("aw_swapteams")+1
if(x > 1) x=0
set_cvar_num("aw_swapteams",x)
war_show_sm(id)
}
case 5: {
x = get_cvar_num("aw_ot_rounds")+1
if(x > 15) x=2
set_cvar_num("aw_ot_rounds",x)
war_show_sm(id)
}
case 6: {
x = get_cvar_num("aw_clantagcheck")+1
if(x > 1) x = 0
set_cvar_num("aw_clantagcheck",x)
war_show_sm(id)
}
case 7: {
delete_file(filename)
log_settings(filename)
war_show_sm(id)
}
case 8: {
sm_page--
war_show_sm(id)
}
case 9: war_show_mm(id)
}
}
return PLUGIN_HANDLED
}
public war_show_sm(id) {
#if defined DEBUG
server_print("* war_show_sm(%d)",id)
#endif
Тут не было кода в исходнике я вставил вот этот
if (id && !((get_user_flags(id) & ADMIN_LEVEL_B))) {
war_clienttext("clt_noaccess",id)
return PLUGIN_HANDLED
}
new menu_body[512]
new keys
new len = format(menu_body,511,"\yAMX War Settings: Page %d^n\dIf two maps are being played and gametype is either mr or tl,^ntied games switch has no effect^nCointoss will randomly choose wich team begins as CT^n^n",sm_page)
new q_format[11][20] = { "No", "Ye s", "A sk", "D isab le", "N am e or IP", "IP", "N am e", "N am e and IP", "O ff", "Co in to ss", "Kn ife"}
war_fixcvar("aw_tie",0,1)
war_fixcvar("aw_assign_mode",0,2)
war_fixcvar("aw_autoteam",0,1)
war_fixcvar("aw_clantagcheck",0,1)
war_fixcvar("aw_demos",0,2)
war_fixcvar("aw_screenshots",0,2)
if(sm_page==0)
{
if((war_live != 0) && (war_live != 5)) {
len += format(menu_body[len],511-len, "\w1. Tied games\R\y%s",q_format[get_cvar_num("aw_tie")])
len += format(menu_body[len],511-len,"^n\d2. Countdown Timer\R\d%d",get_cvar_num("aw_countdowntime"))
len += format(menu_body[len],511-len,"^n\w3. Warmup timelimit\R\y%d",get_cvar_num("aw_warmup_timelimit"))
len += format(menu_body[len],511-len,"^n\d4. Assign Team mode\R\d%s",q_format[get_cvar_num("aw_assign_mode")+8])
len += format(menu_body[len],511-len,"^n\w5. Autoassign teams\R\y%s",q_format[get_cvar_num("aw_autoteam")])
len += format(menu_body[len],511-len,"^n\d6. Record client demos\R\d%s",q_format[get_cvar_num("aw_demos")])
len += format(menu_body[len],511-len,"^n\w7. Take client screenshots\R\y%s^n",q_format[get_cvar_num("aw_screenshots")])
len += format(menu_body[len],511-len,"^n\y8. Save amxwar.cfg")
len += format(menu_body[len],511-len,"^n\y9. More")
len += format(menu_body[len],511-len,"^n\y0. Back")
keys = (1<<0|1<<2|1<<4|1<<6|1<<7|1<<8|1<<9)
}
else {
len += format(menu_body[len],511-len, "\w1. Tied games\R\y%s",q_format[get_cvar_num("aw_tie")])
len += format(menu_body[len],511-len, "^n\w2. Countdown Timer\R\y%d",get_cvar_num("aw_countdowntime"))
len += format(menu_body[len],511-len, "^n\w3. Warmup timelimit\R\y%d",get_cvar_num("aw_warmup_timelimit"))
len += format(menu_body[len],511-len, "^n\w4. Assign Team mode\R\y%s",q_format[get_cvar_num("aw_assign_mode")+8])
len += format(menu_body[len],511-len, "^n\w5. Autoassign teams\R\y%s",q_format[get_cvar_num("aw_autoteam")])
len += format(menu_body[len],511-len, "^n\w6. Record client demos\R\y%s",q_format[get_cvar_num("aw_demos")])
len += format(menu_body[len],511-len, "^n\w7. Take client screenshots\R\y%s^n",q_format[get_cvar_num("aw_screenshots")])
len += format(menu_body[len],511-len, "^n\y8. Save amxwar.cfg")
len += format(menu_body[len],511-len, "^n\y9. More")
len += format(menu_body[len],511-len, "^n\y0. Exit")
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
}
}
if(sm_page==1)
{
len += format(menu_body[len],511-len, "\w1. Only kill frags\R\y%s", q_format[get_cvar_num("aw_onlykillfrags")])
len += format(menu_body[len],511-len,"^n\w2. Check player ip\R\y%s", q_format[get_cvar_num("aw_check_ip")])
len += format(menu_body[len],511-len,"^n\w3. Check player name\R\y%s", q_format[get_cvar_num("aw_check_name")])
len += format(menu_body[len],511-len,"^n\w4. Return money by\R\y%s", q_format[get_cvar_num("aw_return_money_by")+3])
len += format(menu_body[len],511-len,"^n\w5. Swap teams\R\y%s",q_format[get_cvar_num("aw_swapteams")])
if(period_number==0) len += format(menu_body[len],511-len,"^n\w")
else len += format(menu_body[len],511-len,"^n\d")
len += format(menu_body[len],511-len,"6. Overtime rounds\R\y%d",get_cvar_num("aw_ot_rounds"))
if(war_live != 0) len += format(menu_body[len],511-len,"^n\d")
else len += format(menu_body[len],511-len,"^n\w")
len += format(menu_body[len],511-len,"7. Require clantags\R\y%s",q_format[get_cvar_num("aw_clantagcheck")])
len += format(menu_body[len],511-len,"^n^n\y8. Save amxwar.cfg")
len += format(menu_body[len],511-len,"^n\y9. Back")
len += format(menu_body[len],511-len,"^n\y0. Exit")
keys = (1<<0|1<<1|1<<2|1<<3|1<<4)
if(period_number==0) keys += (1<<5)
if(war_live==0) keys += (1<<6)
keys += (1<<7|1<<8|1<<9)
}
show_menu(id,keys,menu_body)
return PLUGIN_HANDLED
}
public war_action_wm(id,key){
#if defined DEBUG
server_print("* war_action_wm(%d,%d)",id,key)
#endif
switch(key) {
case 8: {
new curmap[32],ctmp1[32],ctmp2[32]
get_mapname(curmap,31)
if(contain(clans[clan1_toshow],"(AUTO)") != -1)
format(ctmp1,strlen(clans[clan1_toshow])-6,"%s",clans[clan1_toshow])
else format(ctmp1,31,"%s",clans[clan1_toshow])
if(contain(clans[clan2_toshow],"(AUTO)") != -1)
format(ctmp2,strlen(clans[clan2_toshow])-6,"%s",clans[clan2_toshow])
else format(ctmp2,31,"%s",clans[clan2_toshow])
new tmpp[4]
format(tmpp,4,"%s",menu_gametype)
client_cmd(id,"aw %s %s %i %s%i map=%s %s%s cfg=%s",ctmp1,ctmp2,menu_minready,menu_gametype,menu_maxrounds,(map1_toshow == 1) ? curmap : maps[map1_toshow],(map2_toshow != 0) ? "map2=":"", (map2_toshow != 0) ? maps[map2_toshow] : "",cfgs[cfg_toshow])
client_cmd(id,"echo %s %s %i %s%i map=%s %s%s cfg=%s",ctmp1,ctmp2,menu_minready,menu_gametype,menu_maxrounds,(map1_toshow == 1) ? curmap : maps[map1_toshow],(map2_toshow != 0) ? "map2=":"", (map2_toshow != 0) ? maps[map2_toshow] : "",cfgs[cfg_toshow])
}
case 9:
war_show_mm(id)
case 0: {
if(clan1_toshow == num_clans-1) clan1_toshow = 0
else clan1_toshow++
if(clan1_toshow == clan2_toshow)
if(clan1_toshow >= num_clans-1) clan1_toshow = 0
else clan1_toshow++
war_show_wm(id)
}
case 1: {
if(clan2_toshow == num_clans-1) clan2_toshow = 0
else clan2_toshow++
if(clan2_toshow == clan1_toshow)
if(clan2_toshow >= num_clans-1) clan2_toshow = 0
else clan2_toshow++
war_show_wm(id)
}
case 2: {
if(menu_minready >= 10) menu_minready = 1
else menu_minready++
war_show_wm(id)
}
case 3: {
if(menu_maxrounds >= 120) menu_maxrounds = 2
else if(menu_maxrounds >= 60) menu_maxrounds += 10
else if(menu_maxrounds >= 20) menu_maxrounds += 5
else menu_maxrounds++
war_show_wm(id)
}
case 4: {
if(equal(menu_gametype,"mr")) format(menu_gametype,2,"mx")
else if(equal(menu_gametype,"mx")) format(menu_gametype,2,"mz")
else if(equal(menu_gametype,"mz")) format(menu_gametype,2,"tl")
else if(equal(menu_gametype,"tl")) format(menu_gametype,2,"tx")
else if(equal(menu_gametype,"tx")) format(menu_gametype,2,"wl")
else if(equal(menu_gametype,"wl")) format(menu_gametype,2,"mr")
war_show_wm(id)
}
case 5: {
if(map1_toshow >= num_maps-1) map1_toshow = 1
else map1_toshow++
war_show_wm(id)
}
case 6: {
if(map2_toshow >= num_maps-1) map2_toshow = 0
else if(map2_toshow == 0) map2_toshow = 2
else map2_toshow++
war_show_wm(id)
}
case 7: {
if(cfg_toshow >= num_cfgs-1) cfg_toshow = 0
else cfg_toshow++
war_show_wm(id)
}
}
return PLUGIN_HANDLED
}
public war_show_wm(id) {
#if defined DEBUG
server_print("* war_show_wm(%d)",id)
#endif
new menu_body[512],tmp1[4],tmp2[4]
num_to_str(menu_minready,tmp1,4)
num_to_str(menu_maxrounds,tmp2,4)
new keys = (1<<9)|(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)
new len = format(menu_body,511,"\yAMX War Start^n^n")
len += format(menu_body[len],511-len,"\w1. Team 1: \y%s^n",clans[clan1_toshow])
len += format(menu_body[len],511-len,"\w2. Team 2: \y%s^n",clans[clan2_toshow])
len += format(menu_body[len],511-len,"\w3. Players on each team: \y%s^n",tmp1)
if((equal(menu_gametype,"tl")) || (equal(menu_gametype,"tx"))) len += format(menu_body[len],511-len,"\w4. Timelimit")
else if(equal(menu_gametype,"wl")) len += format(menu_body[len],511-len,"\w4. Winlimit")
else len += format(menu_body[len],511-len,"\w4. Maxrounds")
len += format(menu_body[len],511-len,": \y%s^n",tmp2)
len += format(menu_body[len],511-len,"\w5. Gametype: \y%s^n",menu_gametype)
len += format(menu_body[len],511-len,"\w6. Map 1: \y%s^n",maps[map1_toshow])
len += format(menu_body[len],511-len,"\w7. Map 2: \y%s^n",maps[map2_toshow])
len += format(menu_body[len],511-len,"\w8. Configfile: \y%s^n^n",cfgs[cfg_toshow])
len += format(menu_body[len],511-len,"\y9. Start War^n")
format(menu_body[len],511-len,"\y0. Back")
show_menu(id,keys,menu_body)
return PLUGIN_HANDLED
}
public war_action_sts(id,key){
#if defined DEBUG
server_print("* war_action_sts(%d,%d)",id,key)
#endif
new myteam[32], tmp
get_user_team(id,myteam,31)
if(equal(myteam,"CT")) tmp = 0; else tmp = 1
switch(key)
{
case 0: {
if(tmp==0) //Win team1
{
set_task(1.0,"swap_teams")
t1startside = 1
t2startside = 0
}
r_r("1")
set_task(6.0,"war_prestart")
}
case 1: {
if(tmp==1) //Win team2
{
set_task(1.0,"swap_teams")
t1startside = 1
t2startside = 0
}
r_r("1")
set_task(6.0,"war_prestart")
}
}
half_active = 1
assigned = 1
return PLUGIN_CONTINUE
}
public war_show_sts(id){
#if defined DEBUG
server_print("* war_show_sts(%d)",id)
#endif
new menu_body[512], len
new keys = (1<<0)|(1<<1)
len = format(menu_body,255,"\ySELECT START SIDE:")
len += format(menu_body[len],255 - len,"^n\w 1. Terrorists")
len += format(menu_body[len],255 - len,"^n\w 2. Counter-terrorists")
show_menu(id,keys,menu_body)
return PLUGIN_HANDLED
}
public war_loadini() {
#if defined DEBUG
server_print("* war_loadini()")
#endif
new inifile[64]
format(inifile,63,"%s/clans.ini", cfgdir)
if (!file_exists(inifile)) return 0
new text[128], tag[32], len, pos = 0
num_clans = 0
while(read_file(inifile,pos++,text,127,len)) {
if ((text[0] != ';') && (strlen(text) > 1) && (num_clans < 64)) { // ; = comment
format(clans[num_clans],31,"%s",text)
num_clans++
}
}
format(inifile,63,"%s/maps.ini", cfgdir)
if (!file_exists(inifile)) return 0
pos = 0
num_maps = 2
maps[0] = "None"
maps[1] = "Current"
while(read_file(inifile,pos++,text,127,len)) {
if ((text[0] != ';') && (strlen(text) > 1) && (num_maps < 32)) {
format(maps[num_maps],31,"%s",text)
num_maps++
}
}
format(cfgs[num_cfgs],31,"default")
num_cfgs = 1
new tmp[128]
format(tmp,127,"%s/cfg",cfgdir)
new DirH = open_dir(tmp,tag,31);
while(next_file(DirH,tag,31)) {
#if defined DEBUG
server_print("====>>> %s <<<====", tag)
#endif
if(contain(tag,".cfg") != -1) {
if(!equali(tag,"default.cfg")) {
copyc(cfgs[num_cfgs],31,tag,'.')
num_cfgs++
if(num_cfgs==64) break;
}
}
}
close_dir(DirH)
return PLUGIN_CONTINUE
}
public war_findtags(){
#if defined DEBUG
server_print("* war_findtags()")
#endif
new players[32],playername[64],num_players, i, j, tmp[64]
get_players(players,num_players,"e","CT")
for(i=0;i<num_players;i++)
{
get_user_name(players[i], playername, 63)
#if defined DEBUG
server_print("%s",playername)
#endif
for(j=0;j<num_clans;j++){
format(tmp,63,"%s",clans[j][1])
tmp[strlen(tmp)-1]=0
#if defined DEBUG
server_print("====>>> %s",tmp)
#endif
if(containi(playername, tmp)==0){
#if defined DEBUG
server_print("found %s - %d",tmp, j)
#endif
clan1_toshow = j;
break;
}
}
}
get_players(players,num_players,"e","TERRORIST")
for(i=0;i<num_players;i++)
{
get_user_name(players[i], playername, 63)
#if defined DEBUG
server_print("%s",playername)
#endif
for(j=0;j<num_clans;j++) if(clan1_toshow!=j) {
format(tmp,63,"%s",clans[j][1])
tmp[strlen(tmp)-1]=0
#if defined DEBUG
server_print("====>>> %s",tmp)
#endif
if(containi(playername, tmp)==0){
#if defined DEBUG
server_print("found %s - %d",tmp, j)
#endif
clan2_toshow = j;
break;
}
}
}
return PLUGIN_CONTINUE
}