Raised This Month: $32 Target: $400
 8% 

Natural Selection incompatibility with plmenu plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drek
Member
Join Date: Mar 2004
Old 01-20-2005 , 13:36   Natural Selection incompatibility with plmenu plugin
Reply With Quote #1

I'm trying to install AMXX on my NS server, however, I have run into a small snag. I would like to use the plmenu plugin, but when I select transfer it attempts to transfer to CT or TERRORIST and gets stuck in an endless loop. Is there a version of plmenu out there that is compatible with NS and specifically the nscommands plugin?

If there isn't that available, is there any way for me to remove the transfer code? I don't need the menu for transfers, although it would be nice, but I can't have AMXX getting stuck in an endless loop when someone chooses the team transfer option. I would also like to keep the plmenu plugin because of all of the kicking and banning options.
Drek is offline
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 01-20-2005 , 16:40  
Reply With Quote #2

NS2AMX? :X
__________________
f1del1ty.oXi is offline
Drek
Member
Join Date: Mar 2004
Old 01-20-2005 , 17:03  
Reply With Quote #3

What the hell are you going on about? I have the ns_amxx module enabled. I have the ns_commands plugin enabled... please don't post if you don't have anything useful to add to the thread...
Drek is offline
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 01-20-2005 , 17:43  
Reply With Quote #4

The maybe you should post the obvious. That should allow you to do it if I'm not mistaken. also check modns.org, it's the best place for Ns plugins.

And you don't have to be an ass about it, if you said that in the first post I wouldn't have said it.

If you don't want the transfer code, just don't use that part of the plugin. amx_marine is a command, so you should try that. =\
__________________
f1del1ty.oXi is offline
Drek
Member
Join Date: Mar 2004
Old 01-20-2005 , 17:59  
Reply With Quote #5

The problem is that the option to transfer to CT or Terrorist is in the AMX menu. Even if I don't use it, someone is bound to try it, if for no other reason than plain old curiosity. When you attempt to transfer someone to CT or Terrorist, AMXX gets caught in an endless loop. What I need is some way to completely disable the transfer code. I suppose it may involve more than just the plmenu plugin, because I expect that using the command would have the same effect. If someone could tell me what code to remove, if that is an option, I would glad take out the code and compile the plugin(s). What do other NS server admins do? I can't imagine that anyone running a pub server would risk having an active command that results in an endless loop.

And sorry, I'm a little short on patience today.
Drek is offline
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 01-20-2005 , 20:17  
Reply With Quote #6

comment out the code itself, and let me find it. Gimme a sec.

ok, first off you can do this:

Code:
 register_clcmd("amx_kickmenu","cmdKickMenu",ADMIN_KICK,"- displays kick menu")
  register_clcmd("amx_banmenu","cmdBanMenu",ADMIN_BAN,"- displays ban menu")
  register_clcmd("amx_slapmenu","cmdSlapMenu",ADMIN_SLAY,"- displays slap/slay menu")
  // register_clcmd("amx_teammenu","cmdTeamMenu",ADMIN_LEVEL_A,"- displays team menu")
  register_clcmd("amx_clcmdmenu","cmdClcmdMenu",ADMIN_LEVEL_A,"- displays client cmds menu")
Comment out the amx_teammenu from being used. This won't stop it from being used in amxmodmenu though, so we must go a step further.

Code:
/* Team menu */

public actionTeamMenu(id,key) {
  switch (key) {
    case 7:{
      g_menuOption[id] = 1 - g_menuOption[id]
      displayTeamMenu(id,g_menuPosition[id])
    }
    case 8: displayTeamMenu(id,++g_menuPosition[id])
    case 9: displayTeamMenu(id,--g_menuPosition[id])
    default: {
      new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
      new authid[32],authid2[32], name[32], name2[32]
      get_user_name(player,name2,31)
      get_user_authid(id,authid,31)
      get_user_authid(player,authid2,31)
      get_user_name(id,name,31)

      log_amx("Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")", 
          name,get_user_userid(id),authid, name2,get_user_userid(player),authid2, g_menuOption[id] ? "TERRORIST" : "CT"  )

      switch (get_cvar_num("amx_show_activity")) {
        case 2: client_print(0,print_chat,"%L",id,"ADMIN_TRANSF_2",name,name2,g_menuOption[id] ? "TERRORIST" : "CT" )
        case 1: client_print(0,print_chat,"%L",id,"ADMIN_TRANSF_1",name2,g_menuOption[id] ? "TERRORIST" : "CT" )
      }

      new limitt = get_cvar_num("mp_limitteams")
      set_cvar_num("mp_limitteams",0)
      user_kill(player,1)
      engclient_cmd(player, "chooseteam")
      engclient_cmd(player, "menuselect", g_menuOption[id] ?  "1" : "2" )
      engclient_cmd(player, "menuselect", "5")
      client_cmd(player,"slot1")
      set_cvar_num("mp_limitteams",limitt)

      displayTeamMenu(id,g_menuPosition[id])
    }
  }
  return PLUGIN_HANDLED
}


displayTeamMenu(id,pos) {
  if (pos < 0)  return

  get_players(g_menuPlayers[id],g_menuPlayersNum[id])

  new menuBody[512]
  new b = 0
  new i, iteam
  new name[32], team[4]
  new start = pos * 7

  if (start >= g_menuPlayersNum[id])
    start = pos = g_menuPosition[id] = 0

  new len = format(menuBody,511, g_coloredMenus ? 
    "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
    id,"TEAM_MENU",pos+1,(  g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )

  new end = start + 7
  new keys = MENU_KEY_0|MENU_KEY_8

  if (end > g_menuPlayersNum[id])
    end = g_menuPlayersNum[id]

  for (new a = start; a < end; ++a) {
    i = g_menuPlayers[id][a]
    get_user_name(i,name,31)
    iteam = get_user_team(i,team,3)

    if ( (iteam == (g_menuOption[id] ? 1 : 2)) || access(i,ADMIN_IMMUNITY) ) {
      ++b   
      if ( g_coloredMenus )
        len += format(menuBody[len],511-len,"\d%d. %s\R%s^n\w",b,name,team)
      else
        len += format(menuBody[len],511-len,"#. %s   %s^n",name,team)
    }
    else {
      keys |= (1<<b)
      len += format(menuBody[len],511-len, g_coloredMenus ? 
        "%d. %s\y\R%s^n\w" : "%d. %s   %s^n",++b,name,team)
    }
  }

  len += format(menuBody[len],511-len,"^n8. %L^n",id,"TRANSF_TO",g_menuOption[id] ? "TERRORIST" : "CT" )

  if (end != g_menuPlayersNum[id])
  {
    format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
    keys |= MENU_KEY_9
  }
  else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")

  show_menu(id,keys,menuBody,-1,"Team Menu")
}

public cmdTeamMenu(id,level,cid) {
  if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED

  g_menuOption[id] = 0

  displayTeamMenu(id,g_menuPosition[id] = 0)

  return PLUGIN_HANDLED 
}
By the looks of it just REMOVING all of that should do it, so that it cannot be used. There IS another option though.

Or so I thought.

Try that and see, you can change the name or maybe commenting out the line for the menu in menufront.sma may get rid of the team menu as an option, I've not tested it though.

good luck
__________________
f1del1ty.oXi is offline
Drek
Member
Join Date: Mar 2004
Old 01-21-2005 , 09:25  
Reply With Quote #7

Thank you very much for the suggestions. I'll try it and let you know if it works.

- What I fail to understand is why AMXX was made mod specific... Any code that was specific to an individual mod should have been included in seperate plugins that could be used, or not, or rewritten depending on the mod... Unless of course the creators of AMXX intended for AMXX to only be used for CS... *grumbles*
Drek is offline
Drek
Member
Join Date: Mar 2004
Old 01-21-2005 , 11:00  
Reply With Quote #8

Regrettably it didn't work so well. It completely snarfed the amxmodmenu. The only option that worked anymore was the exit the menu option...

Thanks for trying though, it is appreciated.

edit: Scratch this response, I'm going to try again. Hard to believe, but I screwed something up, I'll report back again after I've given it another shot.
Drek is offline
Drek
Member
Join Date: Mar 2004
Old 01-21-2005 , 11:33  
Reply With Quote #9

Ok, well now the options that I don't want available aren't available and the ones I do want available are, but when I press the numbers, nothing happens. This is a different problem though I expect, I will do a search and see what I can find.

edit: And I found the answer. Keybinds weren't set up correctly. Now it will work hopefully... such a nub...
Drek is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode