It's only possible to make players hear in certain area using sv_sound2
Forum




It's only possible to make players hear in certain area using sv_sound2
1
parse("sv_sound2 \"snd path\"")
just this?
and can you help me?, i have bug :
1
msg("©255000000'..player(id,"name")..' is noob!")
What's wrong here?
edited 2×, last 11.03.10 09:32:06 pm
DRoNe has written
1
msg([b]"©255000000'[/b]..player(id,"name")..[b]' is noob!"[/b])
If you are starting string with " then you should finish the same.




fixed.
I'm making a big Role-Playing Map and i want a level script how can i make a script like this;


I've another question but first i must know this level script

1: With a trigger, could you use the for i=1,32 do for it?
2: I am trying to strip a primary weapon or secondary weapon if they have one, and equip another one, Can I see the type of weapons they have?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function addWeapon(id,wpnid, type) 	local haswpn 	for i, v in ipairs(playerweapons(id)) do 		if type == 1 then 			for j, k in ipairs{10,11,20,21,22,23,24,38,39,30,32,31,33,34,35,36,37,40} do 				if v == k then 					parse('strip '..id..' '..v) 					haswpn = true 					break 				end 			end 		else 			for j, k in ipairs{1,2,3,4,5,6} do 				if v == k then 					parse('strip '..id..' '..v) 					haswpn = true 					break 				end 			end 		end 		if haswpn then parse('equip '..wpnid) return true end 	end 	return false end
edited 3×, last 12.03.10 12:03:07 pm
Blazzingxx has written
If you are starting string with " then you should finish the same.
'string'
"string"
'string"
"string'
DRoNe has written
1
msg([b]"©255000000'[/b]..player(id,"name")..[b]' is noob!"[/b])
If you are starting string with " then you should finish the same.




It's very useful for me, thank you

I think it might have to do with the character encoding I use in my lua scripts, but changing doesn't seem to help.
Noxic has written
I'm having trouble with the color-coding in HUD. Instead of changing the color of my text, it adds "©255000000" in front of the text.
I think it might have to do with the character encoding I use in my lua scripts, but changing doesn't seem to help.
I think it might have to do with the character encoding I use in my lua scripts, but changing doesn't seem to help.
The '©#' MUST be first before any other characters
I'm not sure if there's any method to force the player to join the T team, but this will just not allow them to choose a CT.
1
2
3
4
5
6
2
3
4
5
6
addhook('team','onSelectTeam') function onSelectTeam(id, team, look) 	if team == 2 then 		return 1 	end end
DRoNe has written
How i spawn player near CT/T spawn ?
put the entities ct_info near the t_info

Quote
put the entities ct_info near the t_info 

OMG...........i mean in lua

DRoNe has written
OMG...........i mean in lua
Quote
put the entities ct_info near the t_info 

OMG...........i mean in lua

OMG, that not possible and OMG you need to setpos
Few basics misc from CSH objects script.
Note: shoot/attack to see the effect.
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
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
-- Projectiles Stuff Example -- -- Lua Scripting Tutorial Example -- Not Finshed -- obj = {x = {}, y = {}, rot = {}, img = {}, id = {}} addhook("always","obj_update") addhook("attack","obj_add") function obj_remove(id) 	local k, v 	if obj.img[id] then freeimage(obj.img[id]) end 	for k, v in pairs(obj) do table.remove(obj[k], id) end end function obj_add(p) 	local x , y, rot , id = player(p,"x"), player(p,"y"), player(p,"rot") 	id = image("gfx/sprites/flare2.bmp",x,y,1) 	imageblend(id, 1) 	table.insert(obj.img, id) 	table.insert(obj.x, x) 	table.insert(obj.y, y) 	table.insert(obj.id, p) 	table.insert(obj.rot, rot) end function obj_update() 	local del, id, n = {} 	for id, n in pairs(obj.img) do 		obj.x[id] = obj.x[id] + math.cos(math.rad(obj.rot[id] - 90)) * 10 		obj.y[id] = obj.y[id] + math.sin(math.rad(obj.rot[id] - 90)) * 10 		imagepos(n, obj.x[id], obj.y[id], obj.rot[id]) 		if tile( math.ceil(obj.x[id] / 32) - 1, math.ceil(obj.y[id] / 32) - 1, "wall") then 			parse("explosion "..obj.x[id].." "..obj.y[id].." 50 250 "..obj.id[id]) 			table.insert(del, id) 		end 	end 	for id, n in ipairs(del) do obj_remove(n) end end
What is k,v and n?

edited 1×, last 13.03.10 07:18:46 pm