SetSoundPaused
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.