SetSoundPaused

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 19:29, 4 September 2026 by QCherry (talk | contribs) (Document client audio API for update 0.1.2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

setSoundPaused

AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Pauses or resumes a sound owned by the current client resource.

Syntax

bool setSoundPaused(number sound, bool paused)

Parameters

Name Type Required Description
sound number yes The resource-owned handle returned by playSound or playSound3D.
paused bool yes True to pause or false to resume playback.

Returns

Returns true when the owned sound is updated; otherwise returns false.

Examples

Pause and later resume a sound:

setSoundPaused(sound, true)
-- Later:
setSoundPaused(sound, false)

Notes

  • Available only in client-side resource scripts.
  • Pausing preserves the handle and playback position.