Forum

> > CS2D > Scripts > Voice chat local
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Voice chat local

1 Antwort
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Voice chat local

_Lima_
User Off Offline

Zitieren
Look, there is a voice chat, I want to make it local and not on the whole map. But the one who speaks is heard only if all the players are together, even if 1 player has gone far, those who stand close to the one who speaks do not hear him.
How to make players speak separately?
For example, first 2 players stand at one end of the map and hear each other, and second 2 players at the other end of the map hear each other but should not hear the first and vice versa.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function dst_voice(x1,y1,x2,y2)
     return math.floor(math.sqrt(math.pow(x1-x2,2)+math.pow(y1-y2,2)))
end

addhook("voice","voicechat")
function voicechat(id)
if player(id,"exists") and player(id,"health") > 0 then
for _, ID in pairs(player(0,"tableliving")) do
dstc = dst_voice(player(id,'x'),player(id,'y'),player(ID,'x'),player(ID,'y'))
if dstc >= 196 then
return 1
end
end
else
return 1
end
end

alt Re: Voice chat local

Mami Tomoe
User Off Offline

Zitieren
It's not possible, the solution would be to have the cs2d lua hook voice give you the receiver ID and have it called for every voice attempt to a player, and that way, you can check it manually.

But that's not a feature, you're free to ask for it, though.
1× editiert, zuletzt 26.05.21 16:43:39
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht