PlayerPlaySound

PlayerPlaySound

Description:
Function PlayerPlaySound plays the specified sound for a player.
Only use the coordinates if you want the sound to be played at a certain position. Set coordinates all to 0.0 to just play the sound.


Parameters:
(playerid, soundid, Float:x, Float:y, Float:z))
int playerid The ID of the player for whom to play the sound.
int soundid The sound to play.
float X X coordinate for the sound to play at. (0.0 for no position)
float Y Y coordinate for the sound to play at. (0.0 for no position)
float Z Z coordinate for the sound to play at. (0.0 for no position)


Return Values:
  • 1: The function was executed successfully.
  • 0: The function failed to execute. This means the player is not connected.


Examples:
// player punching sound (fits for commands such as /slap well). The sound will be quiet, as the source is actually 10 meters above the player.
PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0);


Related Functions
The following functions may be useful, as they are related to this function in one way or another.