Squirrel/Server/Functions/Sounds/Close
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|Sound.Close}} This function closes a sound. == Syntax == <code>bool Sound.Close( player plr )</code> == Arguments == * '''plr''' - The player to close the so…') |
Latest revision as of 14:32, 17 August 2011
This function closes a sound.
[edit] Syntax
bool Sound.Close( player plr )
[edit] Arguments
- plr - The player to close the sound for
[edit] Example
This code will play the sound 'moo.mp3' for a player when they type '/moo'.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "moo" ) { local sound = FindSound( "moo.mp3" ); if ( sound ) { sound.Open( pPlayer ); sound.Play( pPlayer ); sound.Close( pPlayer ); } } return 1; }
[edit] Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.