Forum

> > CS2D > Scripts > Disable/Enable Options a menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English Disable/Enable Options a menu

11 replies
To the start Previous 1 Next To the start

old Disable/Enable Options a menu

Psytate123
User Off Offline

Quote
Hi (=
Especially I cam here to know one thing for my new lua script ...
I'll give an example
1
Server Action = F3
1
Admin Function = Press f3 to open menu
I press f3 and only opens a menu of administrator (to put it USGN
)


When I press
Appears are options for admins
type

F3> Enable Autoteambalance
F3> Disable AutoTeamBalance

Got it?

want to know how to do it
to enable and disable menu options in the administrator
Sorry for my english, I am Italian

Administrator to be in this script is that because the
USGN

everything on the menu but that ok?

Try to understand my English, it's confusing: (

Plz Help me

old Re: Disable/Enable Options a menu

EP
User Off Offline

Quote
That's because you are admin, but it doesn't occur to the normal players. Try to add that menu in the admin menu and you will not have problem. (If that is not the answer I didn't understand you). Good luck!

old Re: Disable/Enable Options a menu

Jynxxx
User Off Offline

Quote
Ok, first you say you want a menu to pop up when you press F3. But then you want it to disable then enable Autoteambalance when you press F3.

old ^^

sheeL
User Off Offline

Quote
user Jynxxx has written
Ok, first you say you want a menu to pop up when you press F3. But then you want it to disable then enable Autoteambalance when you press F3.


You got it wrong ...
he wants this:

F3 (MENU)> AutoTeamBalance [Enable or Disable]

F3> AutoTeamBalance Enable (active if they click)
F3> Disable AutoTeamBalance (if they click off)

But autoteambalance is an example
so would not be a command (autoteambalance) would be more like:

Autoteambalance [Enable or Disable]
Remove bots ... [Enable or Disable]

and I bet you did not read that he does not know how ...
he wants to make a menu with no options, that it puts the options

Understand what He wants?
I just do not do it because I do not know

old Re: Disable/Enable Options a menu

EP
User Off Offline

Quote
if mp_autoteambalance==1 then
     parse("mp_autoteambalance 0")
elseif mp_autoteambalance==0 then
     parse("mp_autoteambalance 1")

THATS JUST AN IDEA

old Re: Disable/Enable Options a menu

MikuAuahDark
User Off Offline

Quote
@user Psytate123
Spoiler >

untested!

old Re: Disable/Enable Options a menu

Psytate123
User Off Offline

Quote
user MikuAuahDark has written
@user Psytate123
Spoiler >

untested!


It does not work but ... thanks for the intention

old Re: Disable/Enable Options a menu

Psytate123
User Off Offline

Quote
user MikuAuahDark has written
@user Psytate123: whew, it's not work?
try to change
1
if player(id,"usgn")==val then
to
1
if player(id,"usgn")==adminlist then
and delete 1 end and delete
1
for num, val in ipairs(adminlist) do


With these changes the script will work?

I did not understand what you mean by that exactly
now you confused me ...

old Re: Disable/Enable Options a menu

EP
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
addhook("serveraction","lol")
function lol(id,a)
if a == 2 then --F3
if player(id,"usgn")== xxxxx or xxxxx or 48086 then -- Replace xxxxx for your usgn or other usgn
	menu(id,"Settings,Autoteambalance|1,Autoteambalance|0")
	end
	end
end

addhook("menu","lold")
function lold(id,a,b)
if a == "Settings" then
	if b == 1 then
		parse("mp_autoteambalance 1")
		msg2(id,"Autoteambalance Activated!")
	elseif b == 2 then
		parse("mp_autoteambalance 0")
		msg2(id,"Autoteambalance Deactivated!")
	end
end
end
It works. :D!
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview