Forum
CS2D Scripts Distance chatDistance chat
1 reply 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","_say") addhook("sayteam","_say") max_dist=20 --max range for message to be heard in tiles function _say(id,message) 	if player(id,"health")>0 then 		for _,id2 in ipairs(player(0,"tableliving")) do 			if math.abs(player(id,"tilex")-player(id2,"tilex"))<max_dist and math.abs(player(id,"tiley")-player(id2,"tiley"))<max_dist then 				msg2(id2,player(id,"name")..": "..message) 			end 		end 	end return 1 end
1