Forum

> > CS2D > Scripts > Drop Money Menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English Drop Money Menu

4 replies
To the start Previous 1 Next To the start

old Drop Money Menu

samucaj
User Off Offline

Quote
Hey guys, i have a problem with the button to open Drop money menu. I wish that when you press the button "Server Action 2" the menu of "Drop Money" opened. I've tried and failed I could ... Someone help me?

1
2
3
4
5
6
7
8
9
10
11
addhook("menu", "RPmenu")
function RPmenu(id, tile, button)
     if title == "Drop Money" then
          if button == 0 then
               return
          end
          menu(id, "Drop Money,10,500,1000,5000,10000,50000,100000")
          if button == 1 then
               if addmoney(id, -100) then
                    parse(string.format("spawnitem 66 %i %i", player(id, "tilex"), player(id, "tiley")))
               end

old Re: Drop Money Menu

danh
User Off Offline

Quote
1
2
3
4
addhook("serveraction","_sact")
function _sact(id,act)
	if act==1 then
		menu(id,"Admin Menu,Server Settings,Spawn Creature,Spawn Object,Spawn Item,V.I.P,Punish,Give Items,Restart,More -->")

basicly u hav to put the menu u want to appear when u pres the button on a Server Action hook

so u would hav
1
2
3
4
5
6
7
addhook("serveraction","_sact")
function _sact(id,act)
	if act==1 then
		menu(id, "Drop Money,10,500,1000,5000,10000,50000,100000")
		end
	end
end

...i think

P.S.(if this works, itl be the 1st time iv helped som1)

old Re: Drop Money Menu

Apache uwu
User Off Offline

Quote
I believe you have an extra end...

1
2
3
4
5
6
7
addhook("serveraction","_sact")
function _sact(id,act)
	if act==1 then
		menu(id, "Drop Money,10,500,1000,5000,10000,50000,100000")
		-->end<--
	end
end

old Re: Drop Money Menu

samucaj
User Off Offline

Quote
and now? this is correct?

1
2
3
4
5
6
7
addhook("menu","Dropmenu")
function Dropmenu(id,title,buton)
if title=="Drop Money" then
if button==1 then
               if addmoney(id, -100) then
                    parse(string.format("spawnitem 66 %i %i", player(id, "tilex"), player(id, "tiley")))
               end

old Re: Drop Money Menu

Apache uwu
User Off Offline

Quote
ffs use tabs...

and no that won't work.

1
2
3
4
5
6
7
8
9
10
11
addhook("menu","Dropmenu")

function Dropmenu(id,title,buton)
	if title=="Drop Money" then
		if button==1 then
			if addmoney(id, -100) then
				parse(string.format("spawnitem 66 %i %i", player(id, "tilex"), player(id, "tiley")))
			end
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview