Forum

> > CS2D > Scripts > Hook menu button
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Hook menu button

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Hook menu button

Joni And Friends
User Off Offline

Zitieren
I have problem with hook menu, i want to disable button X (closing) i has make the code for test like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("serveraction","_s")
function _s(id,ac)
     if ac==1 then
        menu(id,"Test,1,2,3")
    end
end
addhook("menu","_m")
function _m(id,title,button)
           if title=="Test" then
              if button==0 then
           msg2(id,"You cant close the menu")
           menu(id,"Test,1,2,3")
           end
      end
end
I has disable button close, but when i click button X (closing) then menu is closed, so how to disable button X (closing) ?

alt Re: Hook menu button

Hajt
User Off Offline

Zitieren
I think you can't disable X button, this is impossible.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("serveraction","_s")
addhook("menu","_m")

function _s(id, ac)
	if ac == 1 then
		menu(id,"Test,1,2,3")
	end
end

function _m(id, title, button)
	if title == "Test" then
		if button == 0 then
			menu(id,"Test,1,2,3")
		end
	end
end

alt Re: Hook menu button

DC
Admin Off Offline

Zitieren
Please note that menus can be closed in a lot of ways. Also by simply opening another menu. It's impossible to prevent this so you have to design your menus/scripts with that in mind.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht