Forum

> > CS2D > Scripts > CS2D - Menu Button 2
Forums overviewCS2D overview Scripts overviewLog in to reply

English CS2D - Menu Button 2

12 replies
To the start Previous 1 Next To the start

old CS2D - Menu Button 2

CirtarTheEpic
BANNED Off Offline

Quote
Hello us users i have a menu and the button 2 don't work

Here is my Script it got anything i need:
Spoiler >


Help me us users

old Re: CS2D - Menu Button 2

omg
User Off Offline

Quote
addhook("say","_say")
function _say(id,text,speedmod) <- you have an extra parameter here (speedmod); remove speedmod
if text=="!maket" then
parse("maket "..id)
msg("You Have Been Change in to a T")
return 1
elseif text=="!makect" then
parse("makect "..id)
msg("You Have Been Change in to a CT")
return 1
elseif text=="!12345" then
parse("speedmod "..id.." 100")
return 1
end
end


addhook("menu","_menu")
function _menu(id,menu,button)
if menu=="Menu" then
if button == 1 then
parse("equip "..id.." 65")
parse("setweapon "..id.." 65")--you attempt to set their weapon to item 65...this is a bandage. players cannot use bandages as a weapon. just remove this line
parse("setmoney "..id.." "..player(id,"money")-2000)--you give them the items and deduct 2000 even if they dont have 2000
end--useless end, remove it
elseif button == 2 then
parse("equip "..id.." 64")
parse("setweapon "..id.." 64")--same problem as above
parse("setmoney "..id.." "..player(id,"money")-2000)--same problem as above. also, this medikit costs the same as the bandage lol
end
end

the only other thing that bugs me is the serveraction hook

addhook("serveraction","_action")
function _action(id,a)
if player(id,"team")==2 then--no matter what serveraction they press, as long as theyre a terrorist, it opens the menu
menu(id,"Menu,Item 1|Banage,Item 2|Midkit")
end
end

old Re: CS2D - Menu Button 2

Devil-Thanh
GAME BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("menu","_menu")
function _menu(id,menu,button)
if menu=="Menu" then
     if button == 1 then
          parse("equip "..id.." 65")
          parse("setweapon "..id.." 65")
          parse("setmoney "..id.." "..player(id,"money")-2000)
     elseif button == 2 then
          parse("equip "..id.." 64")
          parse("setweapon "..id.." 64")
          parse("setmoney "..id.." "..player(id,"money")-2000)
     end
end
end

old Re: CS2D - Menu Button 2

CirtarTheEpic
BANNED Off Offline

Quote
user omg: if i press Item 2| Midkit the menu don't gave midkit and never lose money

here is the PROBLEM

addhook("menu","_menu")
function _menu(id,menu,button)
if menu=="Menu" then
     if button == 1 then
          parse("equip "..id.." 65")
          parse("setmoney "..id.." "..player(id,"money")-2000)
     end
     elseif button == 2 then
          parse("equip "..id.." 64")
          parse("setmoney "..id.." "..player(id,"money")-2000)
     end
end

old Re: CS2D - Menu Button 2

Obviously Exactly Myself
User Off Offline

Quote
user Yates has written
user Obviously Exactly Myself has written
Replace all the "button" into "sel".

This makes no difference, you can name them whatever you want.

Do as I said and it will work.

You mean like this?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("menu","_menu")
function _menu(id,menu,button)
	if menu=="Menu" then
		if button == 1 then
			parse("equip "..id.." 65")
			parse("setweapon "..id.." 65")
			parse("setmoney "..id.." "..player(id,"money")-2000)
		elseif button == 2 then
			parse("equip "..id.." 64")
			parse("setweapon "..id.." 64")
			parse("setmoney "..id.." "..player(id,"money")-2000)
		end
	end
end

old Re: CS2D - Menu Button 2

omg
User Off Offline

Quote
why do u try to set the players weapon to a bandage/medikit? it doesnt do anything. simply equipping them with it should give them 20/100 hp, and u could always just use
1
parse("sethealth "..id.." "..player(id,"health")+20)
and
1
parse("sethealth "..id.." "..player(id,"health")+100)
for bandage and medikit, respectively. its easier and faster

just copy and paste this -.-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
_itemlist="50,74";
parse("mp_wpndmg Claw 1")

addhook("spawn","_spawn")
function _spawn(id)
if player(id,"team")==2 then
     return _itemlist;
end
end

addhook("say","_say")
function _say(id,text)
if text=="!maket" then
parse("maket "..id)
msg("You Have Been Change in to a T")
return 1
elseif text=="!makect" then
parse("makect "..id)
msg("You Have Been Change in to a CT")
return 1
elseif text=="!12345" then
parse("speedmod "..id.." 100")
return 1
end
end

addhook("minute","_minute")
function _minute()
     msg("Hello by CirtarTheEpic")
end

addhook("serveraction","_action")
function _action(id,a)
if player(id,"team")==2 then
          menu(id,"Menu,Item 1|Banage,Item 2|Midkit")--i recommend saying how much each of these items cost...
     end
end

addhook("menu","_menu")
function _menu(id,menu,button)
if menu=="Menu" then
     if button == 1 then
          if player(id,"money")>=2000 and player(id,"health")>0 then--i assume u want them to have to pay 2000 for these items and that theyre still alive...
               parse("sethealth "..id.." "..player(id,"health")+20)
               parse("setmoney "..id.." "..player(id,"money")-2000)
          else
               msg2(id,"not enough money")
          end
     elseif button == 2 then
          if player(id,"money")>=2000 and player(id,"health")>0 then
               parse("sethealth "..id.." "..player(id,"health")+100)
               parse("setmoney "..id.." "..player(id,"money")-2000)
          else
               msg2(id,"not enough money")
          end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview