Hit Sound
#1

Hi everyone. I'm looking for bullet hit sound name in this video http://www.youtube.com/watch?v=CGxyY...ature=*********

How can i add this sound to my gamemode script I'm using samp 0.3z.

I'm new in forum, sorry for my bad english and mistakes.
Reply
#2

Under the 'OnPlayerTakeDamage' callback put:
pawn Код:
PlayerPlaySound(issuerid, 17802, 0, 0, 0);
Reply
#3

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.
Reply
#4

Why use OPSP? - There's a function you can use with no includes needed called OnPlayerWeaponShot, which gives the coordinates, and everything. No need to download anything new when you have what you need right here.
Reply
#5

You are quite right. I just stated OPSP because I only thought it was a little (teeny tiny) more advanced than the in-built callbacks for damages and shots.
Reply
#6

As inshal said, you should use the ding sound under OnPlayerGiveDamage, because OnPlayerTakeDamage gets called every time a player takes damage, so you would hear a sound whenever a vehicle hits you or you fall from a building or something like that.
Reply
#7

Thanks it worked, but i got simple error how can i fix it:
Код:
warning 235: public function lacks forward declaration (symbol "OnPlayerTakeDamage")
Thank you again
Reply
#8

Download the latest 0.3z includes. If you have done so and it still gives errors, it simply means that you have multiple version of pawno.

-Forgot to quote. Too lazy to go back and quote.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)