SetPlayerVoiceRange

From Onset Developer Wiki
Revision as of 17:11, 11 January 2021 by BlueMountains (talk | contribs) (Created page with "{{Info|Function|Server|1.4.1}} {{FuncDescription|Sets the voice range of a player. The range can't be greater than the voice distance set in the server_config|server_confi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
SetPlayerVoiceRange

Type: Function
Context: Server
Introduced: v1.4.1

Description

Sets the voice range of a player.

The range can't be greater than the voice distance set in the server_config.json.

To reset the voice range pass a value of 0.0 or less to this function.

Syntax

SetPlayerVoiceRange(player, range)

Parameters

  • player
    The player identifier.
  • range
    The desired voice range.

Return Value

  • This function returns true on success.

Example

function cmd_whisper(player)
    -- Player will be heard only 5 meters (500 cm)
    SetPlayerVoiceRange(player, 500.0)
end
AddCommand("whisper", cmd_whisper)

See also