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
 
(One intermediate revision by one other user not shown)
Line 21: Line 21:
else
else
{
{
PlaySoundForWorld(1, text.tointeger());
PlaySoundForWorld(player.UniqueWorld, text.tointeger());
}
}
}
}
Line 33: Line 33:


{{Scripting/Squirrel/Functions/Game 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.

Related Functions