VoiceStatsHot-path measurement counters returned by Voice.stats.
calls: numberentries: numberrewrites: number@s2script/sdk/voice
who can hear whom.
import { VoiceStats } from "@s2script/sdk/voice";Author-time types ship in the npm package; the engine injects the runtime at plugin load.
Add @s2script/sdk to your plugin's dependencies.
Generated from the shipped type definitions.
VoiceStatsHot-path measurement counters returned by Voice.stats.
calls: numberentries: numberrewrites: numberVoicePer-(receiver, sender) voice hearability.
import { Voice } from "@s2script/sdk/voice";
// A dead player is heard only by other dead players.
Voice.setAudibleTo(deadSlot, otherDeadSlots);
// ...and on respawn, hand the slot back to the engine.
Voice.reset(deadSlot);setAudibleTo(sender: number, receivers: readonly number[]): booleanThis sender is audible ONLY to receivers (0-based slots). An empty array means audible to
nobody — distinct from Voice.reset, which removes the rule and lets the engine decide.
Rules from multiple plugins AND-merge, so another plugin can only ever narrow yours, never widen it.
A rule is dropped automatically when the sender disconnects: slots are recycled, and a rule is
about the player who occupied one, not the seat.
Returns false — never throws — when the rule was NOT applied: voice control is degraded or its
engine hook never installed on this build, sender is outside [0, 64), or any element of
receivers is. Note this differs from import("./transmit").Transmit.setVisibleTo, which
throws RangeError on a bad slot; check the return value here rather than relying on a throw.
Throws — TypeError if receivers is not an array.
reset(sender: number): booleansender; other plugins' rules survive and are re-merged.
false when you had no rule for that sender.resetAll(): voidstats(): VoiceStats | null