From SA-MP Wiki
Plays the specified sound for a player
|playerid||The ID of the player who will hear the sound.|
|soundid||The sound to play.|
|Float:x||X coordinate for the sound to play at (0 for no position)|
|Float:y||Y coordinate for the sound to play at (0 for no position)|
|Float:z||Z coordinate for the sound to play at (0 for no position)|
|Returns||This function doesn't return a specific value|
|Note: Only use the coordinates if you want the sound to be played at a certain position. Set coordinates all to 0 to just play the sound.|
// 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);
The following functions may be useful, as they are related to this function in one way or another.
- PlayCrimeReportForPlayer: Play a crime report for a player.
- PlayAudioStreamForPlayer: Plays a audio stream for a player.
- StopAudioStreamForPlayer: Stops the current audio stream for a player.