You can use
PlayerPlaySound to play
San Andreas' in-built sound "Ding". The ID of that sound is 17802, not quite sure.
Use the function
OnPlayerGiveDamage to create the sound for the player (
playerid in
OnPlayerGiveDamge and
targetid in
OnPlayerTakeDamage)who is getting damage. When a player will shoot someone (successfully) or in other words, give damage, then the sound will be played if you use such method as stated below.
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0); // Ding Sound
return 1;
}
You can also use
OnPlayerTakeDamageinstead of
OnPlayerGiveDamge. They both are almost the same. There is also an include which has a function
OnPlayerShootPlayer which is a little more advanced (in my opinion). OPSP - by wups.
EDIT: OPSP is an include which should be downloaded. OnPlayerGive/TakeDamage and OnPlayerWeaponShot are in-built (I guess I'm using the right word....) as stated by Abagail.