Forum

> > CS2D > Scripts > Trigger use and menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English Trigger use and menu

6 replies
To the start Previous 1 Next To the start

old Trigger use and menu

Mora
User Off Offline

Quote
Hello all :3
I need help in one script:
if trigger_use name is AdminEquip and if i press this trigger then i got menu...
or if name is ModEquip then menu
1
2
3
4
5
6
7
8
9
addhook("triggereqntity","_te")
function _te(id,name)
if trigger_use name is AdminEquip then 
        menu(id,"Adm....bakllalbalblabla")
end
elseif trigger_use name is ModEquip then
        menu(id,"blablablabl")
end
end
Im n**b in scripts and i hope someone help me

Please,sorry me for my english

old Re: Trigger use and menu

Cure Pikachu
User Off Offline

Quote
This I believe?
1
2
3
4
5
6
7
8
addhook("usebutton","_te")
function _te(id,x,y)
	if entity(x,y,"name") == "AdminEquip" then 
		menu(id,"Admin Equip,blah,blah")
	elseif entity(x,y,"name") == "ModEquip" then
		menu(id,"Mod Equip,blah,blah")
	end
end

old Re: Trigger use and menu

Mora
User Off Offline

Quote
hmm i think yes.
get me some time for make menu and try it.
P.s-thanks you @user Cure Pikachu:)))
i will tell you in,i think 3 min...
edited 1×, last 30.08.13 04:10:07 pm

old Re: Trigger use and menu

Dovahkin
User Off Offline

Quote
1
2
3
4
5
6
addhook("usebutton","butts")
function butts(id,tx,ty)
	if (tx == The tile X position and ty == the tile Y position) then --That's must be the location from where the button is!
		menu(id,"AdminEquip@b,EQUP")
	end
end
Use this instead!

Warning! - Don't forget the X and Y position or else it won't work!

Example of an X and Y position -
1
2
3
4
5
addhook("usebutton","test")
function test(id,tx,ty)
	if (tx == 12 and ty == 5) then
	end
end
Go!

Edit - Too late
edited 1×, last 30.08.13 03:58:49 pm

old Re: Trigger use and menu

Mora
User Off Offline

Quote
Thanks you Reduced,but is not for me,sorry.
i need open this menu with trigger NAME,but not with x == ? and y == ?.sorry
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview