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.


If you just want to play a sound, and let the player hear it, simply leave the x y and z coordinates as 0.

This function does not return a specific value, it's best to simply ignore it.


// player punching sound (fits for commands such as /slap well)
PlayerPlaySound(playerid, 1130, 0.0, 0.0, 0.0);
Personal tools