Or you could search through the other 45 pages of good lua, because this has already probably suggested.
Forum
CS2D Scripts Lua Scripts/Questions/HelpOr you could search through the other 45 pages of good lua, because this has already probably suggested.
eg. arena = 51,47
--on spawn
return arena
something like that?
1
2
3
4
5
2
3
4
5
spawn(id)						on spawn -id: player id >return:	"" - (nothing) spawn with regular items 		"x" - spawn with melee weapon only 		"typeid,typeid,..." - spawn with these items and melee
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("menu","buymen") function buymen(id,menu,sel) if (menu=="Select Extra Item (1/1)") then dolars = player(id,"money") if dolars>3999 then 	 parse("equip "..id.." 88") parse("setmoney "..id.." "..player(id,"money")-4000) msg2(id,"©255255255You have bought Portal Gun!") else msg2(id,"©255000000Not enough money to buy Portal Gun!") end end
Guys, I need some help here.. how do I make that Portal Gun can buy ONE time only?
Quote
Guys, I need some help here.. how do I make that Portal Gun can buy ONE time only?
Make value :
portal = array(32)
dont forget that "portal == 1" then round starts.
Then you buy check if "portal = 1" and if it is, buy weapon & portal = 0
If you still dont know how to do that, I will make example.
Admirdee has written
and yes I need example for that
Serveration to call menu
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
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
function array(m) 	local arrays = {} 	for i = 1, m do 		arrays[i]=0 	end 	return arrays end portals = array(32) function portal_menu(id) 	menu(id,'Do you want portal weapon?,YES!,NO!')	 end addhook("startround","startrounds") function startrounds() 	for i = 1,32 do 		if (player(i,"exists")) then 			portals[i] = 0 		end 	end end addhook("serveraction","serveractions") function serveractions(id) 	portal_menu(id) end addhook("menu","menus") function menus(id,menu,sel) 	if (menu=="Do you want portal weapon?") then 		if (sel == 1) then 			if (portals[id]<1) then 				portals[id] = 1 				parse('equip '..id..' 88') 				msg2(id,'You have portal weapon!@C') 			else 				msg2(id,'Only one portal for round!@C') 			end 		end 	end end
Blazzingxx has written
Now if you are making something, dont forget credits
I never forget that thing
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-------------------------------------------------- -- Simple Advertising by Unreal Software -- -- 22.02.2009 - www.UnrealSoftware.de -- -------------------------------------------------- if sample==nil then sample={} end sample.ads={} -------------------------------------- -- WELCOME MESSAGE ON JOIN -- -------------------------------------- addhook("join","sample.ads.join") function sample.ads.join(p) 	msg2(p,"Welcome to my Server, "..player(p,"name").."!") end -------------------------------------- -- ADVERTISING EVERY MINUTE -- -------------------------------------- addhook("minute","sample.ads.minute") function sample.ads.minute() 	msg(p,"Hope your having fun, "..player(p,"name").."!") 	msg(p,"Counter-Strike 2D is awsome!") end
I'm sorry, rushed,
right
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
-------------------------------------- -- ADVERTISING EVERY MINUTE -- -------------------------------------- addhook("minute","sample.ads.minute") function sample.ads.minute() 	for p in ipairs(player(0,"table")) 		do 			msg2(p,"Hope your having fun, "..player(p,"name").."!") 		end 	msg("Counter-Strike 2D is awsome!") end
edited 1×, last 31.08.09 12:12:22 pm
I heard that you can save some variables to files. I want to save ac1, ac2, and ac3. How?
You need to use write and reading functions.
Write:
f = assert(io.open(file_dir,'w'))
f:write(ac1..' '..ac2..' '..ac3)
f:close()
edited 1×, last 31.08.09 02:02:53 pm
EDIT: OK, I spent 3 hours of work, and it works now!
edited 1×, last 31.08.09 03:57:24 pm
mat5b has written
It works, but ac1,ac2 and ac3 resets always when I restart the server, so it isn't actually working.
EDIT: OK, I spent 3 hours of work, and it works now!
EDIT: OK, I spent 3 hours of work, and it works now!
lol, You just need right hooks & also dont forget clear code.
Btw, You get how to read file?
--dofile("sys/lua/samples/utsfx.lua")
and delete the two - in front of it:
dofile("sys/lua/samples/utsfx.lua")
playa slaya has written
how can i make it where insted of killing so many ppl in an ammont of time its how many you kill in all
I will help you, but I dont know what you mean ...
Retype your question