Forum
CS2D Scripts Sound from PlayerSound from Player
5 Antworten 1
1
parse ("sv_sound3 "..x.." "..y.." "..path..")
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
function sound3(id,r,snd) local px,py=player(id,"x"),player(id,"y") for _,v in pairs(player(0,"table")) do local ppx,ppy=player(v,"x"),player(v,"y") local d=math.sqrt((px-ppx)^2+(py-ppy)^2) if (d<=r) then parse("sv_sound2 "..v.." \""..snd.."\"") end end end
That's the Lua function. I didn't put comments because I'm on the phone. I think you'll figure it out. r is radius in pixels.
@kel, You can, silly.
Kel9290 hat geschrieben
i said about volume of sound. like 3d sound
You should have specified what you were talking about - 'you can't do this' directed to a statement about a ranged sound function can be easily misunderstood.
1