PlayerPlaySound

From SA-MP Wiki

Jump to: navigation, search

PlayerPlaySound


This function plays the specified SoundID to the player. The x, y, z values don't seem to affect the sound on some sounds.


Parameters:
(playerid, soundid, Float:x, Float:y, Float:z)
playeridThe ID of the player who will hear the sound.
soundidThe SoundID of the sound to be played.
Float:xX coordinate.
Float:yY coordinate.
Float:zZ coordinate.


This function does not 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)
PlayerPlaySound(playerid, 1130, 0.0, 0.0, 0.0);

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

Personal tools