Forum

> > CS2D > Scripts > Use Button not work
Forums overviewCS2D overview Scripts overviewLog in to reply

English Use Button not work

8 replies
To the start Previous 1 Next To the start

old Use Button not work

thesk5tera
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook("use","_use")
function _use(x,y)
     if (x == 8 and y == 7) then
          menu(id,"Open Door 1,Open For == |600 $.")
     end
	end
	
addhook("menu","_menu")
function _menu(id,title,key)
if (title == "Open Door 1") then
if (key == 1) then
local money = player(id,"money")
if money>599 then
parse("setmoney "..id.." "..(player(id,"money") - 600))

parse("trigger ww1")
end
end
end
end
i test it but not work in map

old Re: Use Button not work

UBMaster
BANNED Off Offline

Quote
1
2
3
4
5
6
addhook("use","_use")
function _use(id,x,y)
     if player(id,"tilex") == 8 and player(id,"tiley") == 7 then
          menu(id,"Open Door 1,Open For == |600 $.")
     end
     end

• Not Tested.

old Re: Use Button not work

_Yank
User Off Offline

Quote
The problem should be in the setmoney line.
Here is my code (i didnt test)
1
2
3
4
5
6
7
8
9
10
11
12
addhook("menu","_menu")
function _menu(id,title,key)
	if (title == "Open Door 1") then
		if (key == 1) then
			local money = player(id,"money")
			if money>599 then
				parse("setmoney "..id.." "..player(id,"money") - 600))
				parse("trigger ww1")
			end
		end
	end
end

PS:UBMaster script will not change anthing.
Why ?
Spoiler >

At least is that what i think
edited 2×, last 17.06.13 04:57:07 pm

old Re: Use Button not work

TimeQuesT
User Off Offline

Quote
parse("setmoney "..id.." "..player(id,"money") - 600))
-->
parse("setmoney "..id.." "..player(id,"money") - 600);

edit:

actually there is no problem in "setmoney line"

old Re: Use Button not work

UBMaster
BANNED Off Offline

Quote
1
2
3
4
5
6
addhook("use","_use")
function _use(id,x,y)
     if player(id,"tilex") == 8 and player(id,"tiley") == 7 then
          menu(id,"Open Door 1,Open For == |600 $.")
     end
     end

you should use it.

old Re: Use Button not work

_Yank
User Off Offline

Quote
Uh you forgot to type event or/and data in the function parameters

1
2
3
4
5
6
7
8
addhook("use","usasa")
function usasa(id,event,data,x,y)
	if x == 8 and y == 7 then
		if event == 100 then
			menu(id,"Open Door 1,Open For == |600 $")
		end
	end
end

EDIT:Sorry i was writting this when UBMaster already write it.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview