Forum

> > CS2D > Scripts > I Need Script Menu Weapon.
Forums overviewCS2D overview Scripts overviewLog in to reply

English I Need Script Menu Weapon.

24 replies
Page
To the start Previous 1 2 Next To the start

old Re: I Need Script Menu Weapon.

Freid
BANNED Off Offline

Quote
Like 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
addhook("serveraction","yu")
function yu(id,act)
if act == 1 then 
menu(id,"Weapons,P228,Deagie,M3,XM1014,M4A1,SG552,AWP,Tactical Shield,Remove Knife")
end
end

addhook("menu","yunu")
function yunu(id,title,button)
if title == "Weapons" then
if button == 1 then
parse("equip "..id.."  4")
elseif button == 2 then
parse("equip "..id.."  3")
elseif button == 3 then
parse("equip "..id.."  10")
elseif button == 4 then
parse("equip "..id.."  11")
elseif button == 5 then
parse("equip "..id.."  32")
elseif button == 6 then
parse("equip "..id.."  31")
elseif button == 7 then
parse("equip "..id.."  36")
elseif button == 8 then
parse("equip "..id.."  41")
elseif button==9 then
parse('removeitem '..item..'50')
end 
end
end

old Re: I Need Script Menu Weapon.

Rainoth
Moderator Off Offline

Quote
@user Freid: That won't work.
1. You're using a nil value 'item'
2. You're using wrong command to remove inventory items
3. The parse string is incorrect as you're using two things at once '..item..'50
1
parse("strip "..id.." 50")
is what would work although I don't advise to strip knife as it can lead to problems.

old Re: I Need Script Menu Weapon.

Yunuu
User Off Offline

Quote
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
addhook("serveraction","yu")
function yu(id,act)
if act == 1 then 
menu(id,"Weapons,P228,Deagie,M3,XM1014,M4A1,SG552,AWB,Tactical Shield")
end
end

addhook("menu","yunu")
function yunu(id,title,button)
if title == "Weapons" then
if button == 1 then
parse("equip "..id.."  4")
elseif button == 2 then
parse("equip "..id.."  3")
elseif button == 3 then
parse("equip "..id.."  10")
elseif button == 4 then
parse("equip "..id.."  11")
elseif button == 5 then
parse("equip "..id.."  32")
elseif button == 6 then
parse("equip "..id.."  31")
elseif button == 7 then
parse("equip "..id.."  36")
elseif button == 8 then
parse("equip "..id.."  41")
elseif button == 9 then
parse("equip "..id.." 74")
parse("strip "..id.." 50")
end 
end
end
Not tested

old Re: I Need Script Menu Weapon.

Talented Doge
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
weap = {"P228","Deagle","M3","XM1014","M4A1","SG552","AWP",'"Tactical Shield"'}
weapons = "P228,Deagle,M3,XM1014,M4A1,SG552,AWP,Tactical Shield"

addhook("serveraction", "_sva")
addhook("menu", "_menu")

function _sva(p, b)
	if b == 1 then menu(p, "Weapons,"..weapons) end
end

function _menu(p, t, b)
	if t == "Weapons" then
		parse("equip "..p.." "..weap[b])
	end
end

I think mine is stupid code though.
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview