SA-MP Forums Archive
OnPlayerGiveDamage or OnPlayerTakeDamage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerGiveDamage or OnPlayerTakeDamage (/showthread.php?tid=484218)



OnPlayerGiveDamage or OnPlayerTakeDamage - Kyance - 29.12.2013

Eh, which one of these makes the 'ding' when you lag shoot?
One of them only makes the "Ding" when directly hitting, but the other one makes the "Ding" when lag-shooting.


Re: OnPlayerGiveDamage or OnPlayerTakeDamage - CrossUSAAF - 29.12.2013

It is your choice, which one to use. I Would suggest you to go with OnPlayerTakeDamage callback. Sound is not played itself, use PlayerPlaySound and find the id of the "ding" sound. Here is more information: https://sampwiki.blast.hk/wiki/PlayerPlaySound.

Tell me if you need more information, glad to help you!

EDIT: And of course remember to play the sound for the issuerid.


Re: OnPlayerGiveDamage or OnPlayerTakeDamage - JJB562 - 29.12.2013

OnPlayerGiveDamage gets called when you the player hits the skin. OnPlayerTakeDamage gets called when the player recieves damage, so this allows lag shooting still. However the ding is not default so you'll have to add the code yourself.

Edit:CrossUSAAF beat me to it..


Re: OnPlayerGiveDamage or OnPlayerTakeDamage - Kyance - 30.12.2013

Quote:
Originally Posted by JJB562
View Post
OnPlayerGiveDamage gets called when you the player hits the skin. OnPlayerTakeDamage gets called when the player recieves damage, so this allows lag shooting still. However the ding is not default so you'll have to add the code yourself.

Edit:CrossUSAAF beat me to it..
Quote:
Originally Posted by CrossUSAAF
View Post
It is your choice, which one to use. I Would suggest you to go with OnPlayerTakeDamage callback. Sound is not played itself, use PlayerPlaySound and find the id of the "ding" sound. Here is more information: https://sampwiki.blast.hk/wiki/PlayerPlaySound.

Tell me if you need more information, glad to help you!

EDIT: And of course remember to play the sound for the issuerid.
Alright thanks!
And yeah, i know that i need to add the script/sound myself.
Thanks again!