this leads to X-Treme lag,because the lines are parse 50times the second!
Forum
CS2D Scripts Lua Scripts/Questions/Helpthis leads to X-Treme lag,because the lines are parse 50times the second!
Don't use always hook because concatenations are slow and what patasuss did would execute really slow.
1
2
3
4
5
6
7
2
3
4
5
6
7
function arr([b]s[/b],[b]v[/b]) [b]t[/b] = {} for i=1, [b]s[/b] do [b]t[/b][i] = [b]v[/b] end return [b]t[/b] end
or
1
2
3
4
5
6
7
2
3
4
5
6
7
function initArray([b]m[/b]) 	local array = {} 	for i = 1, [b]m[/b] do 		array[i]=0 	end 	return array end
What are that letters?
DRoNe has written
or
What are that letters?
1
2
3
4
5
6
7
2
3
4
5
6
7
function arr([b]s[/b],[b]v[/b]) [b]t[/b] = {} for i=1, [b]s[/b] do [b]t[/b][i] = [b]v[/b] end return [b]t[/b] end
or
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
function initArray([b]m[/b]) --define a function that --creates a table with m entries 	local array = {} -- create an empty table 	for i = 1, [b]m[/b] do -- fill m entries with 0 		array[i]=0 	end 	return array -- return the table end
What are that letters?
So basically what it returns is a table filled with m zero's,
array = {0,0,0......}
The second one just makes a table with the size given by m and fills it with 0 on each index.
Some1 help i need to make it just for terrorists
How many letters are ?
Where i find explanatories to all letters ?
DRoNe has written
@Flacko and Yellowbanana
How many letters are ?
Where i find explanatories to all letters ?
How many letters are ?
Where i find explanatories to all letters ?
You have to download common_sense.exe from www.use_your_brain.com/
Khaleed has written
Some1 help i need to make it just for terrorists
Some1 help i need to make it just for terrorists
Maybe this will help (I am a noob...)
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
-------------------------------------------------- -- Glowing Players Script by Unreal Software -- -- 08.11.2009 - www.UnrealSoftware.de -- -------------------------------------------------- if sample==nil then sample={} end sample.glowing={} -- I won't be using the samples table if I were you... -------------------------------------- -- GLOW -- -------------------------------------- -- Glow Function function sample.glowing.makeallglow() 	if (team==1) then 		for i=1,32,1 do 			id=image("gfx/sprites/flare2.bmp",0,0,100+i)	-- Create image @ Player 			imagecolor(id,255,255,0)				-- Make image yellow 			imageblend(id,1)						-- Make image glow 			imagealpha(id,0.5)					-- Decrease Glow Strength 		end 	end end -- Make Glow instantly after starting server sample.glowing.makeallglow() -- Make Glow after roundstart (because images are deleted on roundstart!) addhook("startround","sample.glowing.startround") function sample.glowing.startround() 	sample.glowing.makeallglow() end
Flacko has written
You have to download common_sense.exe from www.use_your_brain.com/
DRoNe has written
@Flacko and Yellowbanana
How many letters are ?
Where i find explanatories to all letters ?
How many letters are ?
Where i find explanatories to all letters ?
You have to download common_sense.exe from www.use_your_brain.com/
omg ...
you dont understand me ...
1
2
3
4
5
6
7
2
3
4
5
6
7
function arr(s,v) t = {} for i=1, s do t[i] = v end return t end
like 's' as Flacko sayd is size and 'v' is value ...
- is something else ?
- if is, then can you explain it ?
Pikachu_Lv85 has written
Maybe this will help (I am a noob...)
Khaleed has written
Some1 help i need to make it just for terrorists
Some1 help i need to make it just for terrorists
Maybe this will help (I am a noob...)
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
-------------------------------------------------- -- Glowing Players Script by Unreal Software -- -- 08.11.2009 - www.UnrealSoftware.de -- -------------------------------------------------- if sample==nil then sample={} end sample.glowing={} -- I won't be using the samples table if I were you... -------------------------------------- -- GLOW -- -------------------------------------- -- Glow Function function sample.glowing.makeallglow() 	if (team==1) then 		for i=1,32,1 do 			id=image("gfx/sprites/flare2.bmp",0,0,100+i)	-- Create image @ Player 			imagecolor(id,255,255,0)				-- Make image yellow 			imageblend(id,1)						-- Make image glow 			imagealpha(id,0.5)					-- Decrease Glow Strength 		end 	end end -- Make Glow instantly after starting server sample.glowing.makeallglow() -- Make Glow after roundstart (because images are deleted on roundstart!) addhook("startround","sample.glowing.startround") function sample.glowing.startround() 	sample.glowing.makeallglow() end
seriously, learn to script..
What is "team" in your script?
This is how it should be.
Patasuss has written
and how about this?
"-hpdmg"a nil value. /error in console/
if enemy hit line [ | | | | | | | | | | ] dont move .... (sry for my english lol)
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
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
math.randomseed(os.time()) addhook("movetile","zmfs") function zmfs(id) local fs = math.random(1,4) 	if player(id,"team") == 1 then 		if fs == 1 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end 		if fs == 2 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end	 		if fs == 3 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end 		if fs == 4 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end end
How i make, that player will every tile drawing image ?
YellowBanana has written
seriously, learn to script..
What is "team" in your script?
This is how it should be.
Pikachu_Lv85 has written
Maybe this will help (I am a noob...)
Khaleed has written
Some1 help i need to make it just for terrorists
Some1 help i need to make it just for terrorists
Maybe this will help (I am a noob...)
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
-------------------------------------------------- -- Glowing Players Script by Unreal Software -- -- 08.11.2009 - www.UnrealSoftware.de -- -------------------------------------------------- if sample==nil then sample={} end sample.glowing={} -- I won't be using the samples table if I were you... -------------------------------------- -- GLOW -- -------------------------------------- -- Glow Function function sample.glowing.makeallglow() 	if (team==1) then 		for i=1,32,1 do 			id=image("gfx/sprites/flare2.bmp",0,0,100+i)	-- Create image @ Player 			imagecolor(id,255,255,0)				-- Make image yellow 			imageblend(id,1)						-- Make image glow 			imagealpha(id,0.5)					-- Decrease Glow Strength 		end 	end end -- Make Glow instantly after starting server sample.glowing.makeallglow() -- Make Glow after roundstart (because images are deleted on roundstart!) addhook("startround","sample.glowing.startround") function sample.glowing.startround() 	sample.glowing.makeallglow() end
seriously, learn to script..
What is "team" in your script?
This is how it should be.
it dont says it have error but isnt workin
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
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
math.randomseed(os.time()) addhook("movetile","zmfs") function zmfs(id) local fs = math.random(1,4) 	if player(id,"team") == 1 then 		if fs == 1 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end 		if fs == 2 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end	 		if fs == 3 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end 		if fs == 4 then 			img = image("gfx/...bmp",1.1,0) 			imagecolor(img,200,0,0) 			imageblend(img,3) 		end end
How i make, that player will every tile drawing image ?
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
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
items = { {title ="Medikit",price = 500,cmd = "equip",param=64}, {title ="Bandage",price = 100,cmd = "equip",param=65}, {title = "Vodka",price=100,cmd = "shake",param=20000}, {title = "PrimaryAmmo",price=300,cmd = "equip",param=61}, {title = "SecondaryAmmo",price=300,cmd = "equip",param=62}, {title = "Snowball",price=3000,cmd = "equip",param=75}, {title = "Armor100",price=1000,cmd = "setarmor",param=100}, {title = "Armor200",price=3000,cmd = "setarmor",param=200}, {title = "Speed x5",price=1000,cmd = "speedmod",param=25}, {title = "Speed x10",price=3000,cmd = "speedmod",param=50}, {title = "MAC10",price=16000,cmd = "equip",param=23} } function createMenu(header, matrix) local menuString = header; menuString = menuString..", " for key, value in ipairs(matrix) do menuString = menuString..value.title.." | $"..tostring(value.price).. "," end return menuString end addhook("serveraction","my_serveraction") function my_serveraction(id,action) if(action == 1) then menu(id,createMenu("Items",items)) end end addhook("menu","my_menu") function my_menu(id,title,button) if(button == 0) then return end if(title == "Items") then if(player(id,"money") > items[button].price) then parse("setmoney "..id.." "..(player(id,"money") - items[button].price)) cmd = string.format("%s %i %i",items[button].cmd,id,items[button].param) parse(cmd) else msg2(id,"©255000000 You have insufficient funds!") end end end
Who Can Make Next Page
but seriously this menu system is gonna suck if you wanna have more pages...
you should ask leegao to help you create a better menu system. I really suck at lua..