Forum

> > CS2D > Scripts > Disable/Enable Options a menu
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Disable/Enable Options a menu

11 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Disable/Enable Options a menu

Psytate123
User Off Offline

Zitieren
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

alt Re: Disable/Enable Options a menu

EP
User Off Offline

Zitieren
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!

alt Re: Disable/Enable Options a menu

Jynxxx
User Off Offline

Zitieren
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.

alt ^^

sheeL
User Off Offline

Zitieren
user Jynxxx hat geschrieben
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

alt Re: Disable/Enable Options a menu

EP
User Off Offline

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

THATS JUST AN IDEA

alt Re: Disable/Enable Options a menu

MikuAuahDark
User Off Offline

Zitieren
@user Psytate123
Spoiler >

untested!

alt Re: Disable/Enable Options a menu

Psytate123
User Off Offline

Zitieren
user MikuAuahDark hat geschrieben
@user Psytate123
Spoiler >

untested!


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

alt Re: Disable/Enable Options a menu

Psytate123
User Off Offline

Zitieren
user MikuAuahDark hat geschrieben
@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 ...

alt Re: Disable/Enable Options a menu

EP
User Off Offline

Zitieren
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!
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht