Scripting/Squirrel/Functions/PlaySoundForWorld: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This Function Plays Sound for any specific World. == SYNTAX == '''PlaySoundForWorld(worldID, soundID)''' == EXAMPLE == <source lang="LUA"> function onPlayerCommand( player,...") |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
This Function | This Function will Play Sounds for any specific World | ||
== | == Syntax == | ||
<pre>PlaySoundForWorld(worldID, soundID)</pre> | |||
== | == Arguments == | ||
<source lang= | * ''int'' '''worldID''' - The world ID. | ||
function onPlayerCommand( player, cmd, text | * ''int'' '''soundID''' - The [[Sounds|sound ID]]. | ||
== Example == | |||
<source lang=squirrel> | |||
function onPlayerCommand( player, cmd, text ); | |||
{ | { | ||
PlaySoundForWorld( | if ( cmd == "playsound" ) | ||
} | { | ||
} | if ( !text ) | ||
{ | |||
MessagePlayer("Syntax: /playsound [Sound ID]", player); | |||
} | |||
else | |||
{ | |||
PlaySoundForWorld(player.UniqueWorld, text.tointeger()); | |||
} | |||
} | |||
} | } | ||
</source> | </source> | ||
=== Notes === | |||
Call [[onPlayerCommand]] were used in this example. More info about them in the corresponding pages. | |||
== Related Functions == | |||
{{Scripting/Squirrel/Functions/Game Functions}} | |||
[[Category:Scripting/Squirrel/Functions/Game_Functions]] |
Latest revision as of 17:19, 25 September 2017
This Function will Play Sounds for any specific World
Syntax
PlaySoundForWorld(worldID, soundID)
Arguments
- int worldID - The world ID.
- int soundID - The sound ID.
Example
function onPlayerCommand( player, cmd, text );
{
if ( cmd == "playsound" )
{
if ( !text )
{
MessagePlayer("Syntax: /playsound [Sound ID]", player);
}
else
{
PlaySoundForWorld(player.UniqueWorld, text.tointeger());
}
}
}
Notes
Call onPlayerCommand were used in this example. More info about them in the corresponding pages.