Forum
CS2D Scripts start weaponstart weapon
9 Antworten 1
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
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
addhook("spawn","onspawn") addhook("serveraction","buymenu") addhook("menu","menuopen") function onspawn(id) menu(id,"Buy Menu,AK-47,M4A1,Deagle,HE") menuopen() end function menuopen(id,title,button) if title == "Buy Menu" then if button == 1 then if player(id,"money") <= 1000 then parse("setmoney "..id.." "..(player(id,"money")-1000)) parse("equip "..id.." 30") elseif button == 2 then if player(id,"money") <= 2000 then parse("setmoney "..id.." "..(player(id,"money")-2000)) parse("equip "..id.." 32") elseif button == 3 then if player(id,"money") <= 500 then parse("setmoney "..id.." "..(player(id,"money")-500)) parse("equip "..id.." 3") elseif button == 4 then if player(id,"money") <= 300 then parse("setmoney "..id.." "..(player(id,"money")-300)) parse("equip "..id.." 51") end end end
Add a entity: info_nobuying in the map.
Fixed
1× editiert, zuletzt 24.08.11 13:49:22
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
Addhook("spawn","start") function start(id) 	menu(id,"The menus name, First weapon, Second weapon, etc") end addhook("menu","tehmenu") function tehmenu(id,t,b) 	if t == "The menus name" then 		if b == 1 then 			parse ("equip "..id.." 1") -- The 1 is the id of the weapon. 		end 	end end
If you can't understand, just use Anti-Grav's script. My script was easier... I think.
Not working!
on line 17 you are missing the 'i' from 'if', fix that.
Anyways, I will make a script, similar to Anti-Grav's one.
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
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
addhook("spawn","spawning") function spawning(id) 	menu(id,"Buy menu, Ak-47 | 1000, M4A1 | 2000, Deagle | 500, HE | 300") end addhook("menu","tehmenu") function tehmenu(id,t,b) 	if t == "Buy menu" then 		if b == 1 then 			if player(id,"money") >= 1000 then 				parse("setmoney "..id.." "..(player(id,"money")-1000)) 				parse("equip "..id.." 30") 			end 		end 		if b == 2 then 			if player(id,"money") >= 2000 then 				parse("setmoney "..id.." "..(player(id,"money")-2000)) 				parse("equip "..id.." 32") 			end 		end 		if b == 3 then 			if player(id,"money") >= 500 then 				parse("setmoney "..id.." "..(player(id,"money")-500)) 				parse("equip "..id.." 3") 			end 		end 		if b == 4 then 			if player(id,"money") >= 300 then 				parse("setmoney "..id.." "..(player(id,"money")-300)) 				parse("equip "..id.." 51") 			end 		end 	end end
Not tested. Tell me if there's a wrong.
Edit: Fixed the <= to >=.
2× editiert, zuletzt 25.08.11 16:32:37
You got the queries for checking money all wrong. It's supposed to be >=, not <= when checking for a player's money.
@ Spook MQ Hacker
Use the script above, I patched that careless mistake he did, along with an extra treat.
1× editiert, zuletzt 25.08.11 16:34:57
1