PlaySoundFrontEnd: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 17: Line 17:
<syntaxhighlight lang="lua">addCommandHandler ( "onPlayerSpawn", root, "onPlayerSpawn" )
<syntaxhighlight lang="lua">addCommandHandler ( "onPlayerSpawn", root, "onPlayerSpawn" )
function onPlayerSpawn ( player )
function onPlayerSpawn ( player )
   playSound ( source, 16 )
   playSound ( player, 16 )
end</syntaxhighlight>
end</syntaxhighlight>


==See Also==
==See Also==
{{Audio_functions}}
{{Audio_functions}}

Revision as of 22:52, 7 June 2006

This function plays a sound for the specified player

Syntax

bool playSound ( player player, sound )   

Required Arguments

  • player: The player you want the sound to play for.
  • sound: A whole integer specifying the sound id to play.

Returns

Returns true if the sound was successfully played , false otherwise.

Example

addCommandHandler ( "onPlayerSpawn", root, "onPlayerSpawn" )
function onPlayerSpawn ( player )
  playSound ( player, 16 )
end

See Also