SA-MP Forums Archive
OnPlayerWeaponShoot - 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: OnPlayerWeaponShoot (/showthread.php?tid=616291)



OnPlayerWeaponShoot - MerryDeer - 03.09.2016

Hi,

If i return 0 OnPlayerTakeDamage never get called?


Re: OnPlayerWeaponShoot - SoLetsGO - 03.09.2016

It will still be called if there is no other script running OnPlayerTakeDamage, but it might be that the player doesn't receive any damage anymore (Im not sure about this).


Re: OnPlayerWeaponShoot - Threshold - 03.09.2016

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

When you return 0 in this callback, the bullet does not do damage and is effectively not seen by other clients. So to them, it will look like you're not shooting anything.

No bullet = No damage = No damage taken (Therefore, no OnPlayerTakeDamage)

I believe OnPlayerGiveDamage is still called however. But if you shoot someone, and return 0 in OnPlayerWeaponShot, that bullet will never reach them.