Raised This Month: $51 Target: $400
 12% 

dynamic menu (custom menu), to trigger additional command alongside


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Marchello
Senior Member
Join Date: Jan 2010
Old 05-08-2010 , 09:26   dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #1

I run l4d2 server, and have it added to my adminmenu_custom.txt
Code:
    "Gamemode"
       {
            "cmd"          "sm_cvar mp_gamemode #1"
            "execute"      "player"
            "admin"        "sm_kick"
            "1"
            {
                 "type"    "list"
                 "1"       "coop"
                 "1."      "Campaign mode"
                 "2"       "versus"
                 "2."      "Versus mode"
                 "3"       "mutation12"
                 "3."      "Realism-versus"
            }
        }
And here's the deal, when it switches game mode it doesn't affect maxplayers, so when I switch to "coop" l4d_maxplayers stays as it is (super versus).

So how get it automatically changing value of "l4d_maxplayers" to 4 as well? (l4d_maxplayers 4)
tried several options, didn't work out.
Marchello is offline
Joe4evr
Member
Join Date: Apr 2010
Old 05-08-2010 , 10:22   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #2

If you want it on all those modes, you can do this.
Code:
    "Gamemode"
       {
            "cmd"          "sm_cvar mp_gamemode #1; l4d_maxplayers 4"
            "execute"      "player"
            "admin"        "sm_kick"
            "1"
            {
                 "type"    "list"
                 "1"       "coop"
                 "1."      "Campaign mode"
                 "2"       "versus"
                 "2."      "Versus mode"
                 "3"       "mutation12"
                 "3."      "Realism-versus"
            }
        }
If it's different per mode, I think it might possible to put it possible in the argument, like this.
Code:
    "Gamemode"
       {
            "cmd"          "sm_cvar mp_gamemode #1"
            "execute"      "player"
            "admin"        "sm_kick"
            "1"
            {
                 "type"    "list"
                 "1"       "coop; l4d_maxplayers 4"
                 "1."      "Campaign mode"
                 "2"       "versus"
                 "2."      "Versus mode"
                 "3"       "mutation12"
                 "3."      "Realism-versus"
            }
        }
Hope that helps.
Joe4evr is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-08-2010 , 10:37   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #3

Quote:
Originally Posted by Joe4evr View Post
If you want it on all those modes, you can do this.
Code:
 "cmd"          "sm_cvar mp_gamemode #1; l4d_maxplayers 4"
If it's different per mode, I think it might possible to put it possible in the argument, like this.
Code:
                 "1"       "coop; l4d_maxplayers 4"
Hope that helps.
Ha-ha, I already tried exact the same! Guess what? Didn't work out too!
Also,
Code:
"1"       "coop; l4d_maxplayers 4"
look how it get resulted:

Last edited by Marchello; 05-08-2010 at 11:57.
Marchello is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-09-2010 , 03:50   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #4

up
Marchello is offline
Joe4evr
Member
Join Date: Apr 2010
Old 05-09-2010 , 07:34   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #5

Ah, I think I found it. Try @1 instead of #1
Joe4evr is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 05-09-2010 , 08:18   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #6

"1" "\"coop\"; l4d_maxplayers 4"

Gamemode is a string, so it takes everything you put in quotes. Try that instead.
__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)
Lebson506th is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-09-2010 , 08:49   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #7

Quote:
Originally Posted by Joe4evr View Post
Ah, I think I found it. Try @1 instead of #1
Had already tried.



Quote:
Originally Posted by Lebson506th View Post
"1" "\"coop\"; l4d_maxplayers 4"

Gamemode is a string, so it takes everything you put in quotes. Try that instead.



Marchello is offline
Joe4evr
Member
Join Date: Apr 2010
Old 05-09-2010 , 09:03   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #8

Quote:
Originally Posted by Marchello View Post
Had already tried.







*Snaps fingers* Mix the two. Using @1 takes out the surrounding quotation marks, but should still use them when you escape them with a backslash.
Joe4evr is offline
Marchello
Senior Member
Join Date: Jan 2010
Old 05-09-2010 , 10:15   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #9

Quote:
Originally Posted by Joe4evr View Post
*Snaps fingers* Mix the two. Using @1 takes out the surrounding quotation marks, but should still use them when you escape them with a backslash.
Can you write down what you implied?
Marchello is offline
Joe4evr
Member
Join Date: Apr 2010
Old 05-09-2010 , 10:37   Re: dynamic menu (custom menu), to trigger additional command alongside
Reply With Quote #10

Basically, what he said:
Code:
"1" "\"coop\"; l4d_maxplayers 4"
Using \" is called escaping in programming jargon. This means that where it would normally be seen as a control character, it's now part of a regular string and won't affect the string as a whole.

Now, if you use @1, the command will be seen as
Code:
mp_gamemode "coop"; l4d_maxplayers 4
which should work in stead of
Code:
mp_gamemode ""coop"; l4d_maxplayers 4"
which translates to the mp_gamemode "" that you got earlier.
Joe4evr 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 08:15.


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