Detect if bullet hit the player
#1

I honestly fear to make these kind of threads in this section, but I haven't found thread that actually explains how to detect if the bullet hit the player - in other terms, detect if the player was shot.

My plan was to play a sound effect for the shooter as the bullet hits the player (no specific area of the body), and a sound effect for the player that was hit.
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
Reply
#3

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage

Read the big orange box
Reply
#4

You should use OnPlayerTakeDamage, because it is called when the damaged player receives damage on his screen.

OnPlayerGiveDamage is called when the issuer id gives damage on his screen, it could be called when the damaged player doesn't "see" on his screen the bullet (for example this callback is called when you shoot an AFK player and you don't give damage actually, but OnPlayerTakeDamage isn't called).
Reply
#5

Thank you, both of you have helped me a bunch. I cannot add reputation to you'se at this time but I'll make sure to do so. Thanks IstuntmanI and Misiur.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)