Scripting/Squirrel/Functions/PlaySoundForWorld: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary
Line 1: Line 1:
This Function Plays Sound for any specific World.
This Function will Play Sounds for any specific World


== SYNTAX ==
== Syntax ==
'''PlaySoundForWorld(worldID, soundID)'''
<pre>PlaySoundForWorld(worldID, soundID)</pre>


== EXAMPLE ==
== Arguments ==


<source lang="LUA">
* ''int'' '''worldID''' - The world ID.
function onPlayerCommand( player, cmd, text )
* ''int'' '''soundID''' - The [[Sounds|sound ID]].
{
 
if ( cmd == "playsound" )
== Example ==
{
<source lang=squirrel>
if ( !text ) MessagePlayer("Syntax: /" + cmd + " [Sound ID]", player );
function onPlayerCommand( player, cmd, text );
else
{
{
PlaySoundForWorld(1, text.tointeger());
if ( cmd == "playsound" )
}
{
}
if ( !text )
{
MessagePlayer("Syntax: /playsound [Sound ID]", player);
}
else
{
PlaySoundForWorld(1, 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}}

Revision as of 15:48, 23 April 2016

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(1, text.tointeger());
		}
	}
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions