Forum

> > CS2D > Scripts > Changing Menu
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Changing Menu

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Changing Menu

BrunoRZ
User Off Offline

Zitieren
I have the following menu here

Zitat
addhook("menu", "action")
function action (id, menu, select)
     if (menu == "Vagas de Emprego") then

     if (select == 1) then
     parse("setpos "..id.." 2800 1427")
     end

     if (select == 2) then
     parse("setpos "..id.." 2090 1150")
     end
     end
end


How can I disable option 2, by selecting it ?
and also adding a description to it ?

alt Re: Changing Menu

EngiN33R
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
disableds2={}

function checkdis2(id)
if disableds2[id] then return "B" end return "(B)"
end

function testmenu(id)
if (not disableds2[id]) then
	menu(id,"Test Menu,A,"..checkdis2(id)..",C")
end

addhook("menu","testmenuf")
function testmenuf(id,menu,sel)
	if (menu=="Test Menu") then
		if (sel==2) then
			if not disableds2[id] then disableds2[id]=true end
		end
	end
end

May not be the best solution, but that's what I use. Also, the second button will only be disabled once - you won't be able to re-enable it unless you use the console.

alt Changing my mind

BrunoRZ
User Off Offline

Zitieren
So I'll quit enabling/disabling button for now.

But how about adding/removing a description for a certain menu option, by choosing it ?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht