Scripting/Squirrel/Functions/PlaySound: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
if ( cmd == "sound" ) | if ( cmd == "sound" ) | ||
{ | { | ||
PlaySound( player.UniqueWorld , 30 , player.Pos ); | |||
} | } | ||
</source> | </source> | ||
Line 19: | Line 18: | ||
* ''int'' '''sound''' - The sound ID | * ''int'' '''sound''' - The sound ID | ||
* ''[[Scripting/Squirrel/Functions/Vector|Vector]]'' '''pos''' - The position of the sound to be played at | * ''[[Scripting/Squirrel/Functions/Vector|Vector]]'' '''pos''' - The position of the sound to be played at | ||
== Notes == | |||
Use [[ | Use [[Scripting/Squirrel/Functions/Player.UniqueWorld|Player.UniqueWorld]] to play sound for a specific player. | ||
== Related Functions == | == Related Functions == | ||
{{Scripting/Squirrel/Functions/Game_Functions}} | {{Scripting/Squirrel/Functions/Game_Functions}} |
Revision as of 19:56, 17 October 2014
This function will play a sound at a certain position.
Syntax
PlaySound( world, sound, pos )
Example
function OnPlayerCommand( player,cmd , text )
if ( cmd == "sound" )
{
PlaySound( player.UniqueWorld , 30 , player.Pos );
}
Arguments
- int world - The world ID
- int sound - The sound ID
- Vector pos - The position of the sound to be played at
Notes
Use Player.UniqueWorld to play sound for a specific player.