SA-MP Forums Archive
Little help for 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: Little help for OnPlayerTakeDamage (/showthread.php?tid=394758)



Little help for OnPlayerTakeDamage - vardanega - 23.11.2012

Hi,

I have a small problem, when a player pushes another player with a weapon, and OnPlayerTakeDamage call, how to make the player no longer receives damage while keeping OnPlayerTakeDamage?

No SetPlayerTeam !

Thanks!


Respuesta: Little help for OnPlayerTakeDamage - Parka - 23.11.2012

SetPlayerTeam ??


Re: Little help for OnPlayerTakeDamage - Azazelo - 23.11.2012

Quote:

no longer receives Dega

Excuse me but what this mean ?


Re : Little help for OnPlayerTakeDamage - Vukilore - 23.11.2012

If you punch somebody with a gun in you hand, (i don't know if its a bug) OnPlayerGive/TakeDamage calcule it as a shot. So if you SetPlayerHealth - 50 with a minigun, every shot with this weapon will take 50HP to the player. And if you punch someone with a minigun in your hands, he'll loose 50 HP.

Punch is not detected when you are armed.


Re : Little help for OnPlayerTakeDamage - vardanega - 23.11.2012

Quote:
Originally Posted by Vukilore
Посмотреть сообщение
If you punch somebody with a gun in you hand, (i don't know if its a bug) OnPlayerGive/TakeDamage calcule it as a shot. So if you SetPlayerHealth - 50 with a minigun, every shot with this weapon will take 50HP to the player. And if you punch someone with a minigun in your hands, he'll loose 50 HP.

Punch is not detected when you are armed.
Yes, this is exactly the problem, it is there are ways to avoid it?


Re : Little help for OnPlayerTakeDamage - Vukilore - 23.11.2012

Quote:
Originally Posted by vardanega
Посмотреть сообщение
Yes, this is exactly the problem, it is there are ways to avoid it?
Je ne sais pas, j'utilise le mкme systиme pour mon serveur RP, et je ne me suis pas encore penchй sur le problиme. Essaye le IsPlayerInRangeOfPoint au pire


Sorry the others, i'm too lazy to translate to english.


Re: Little help for OnPlayerTakeDamage - cessil - 24.11.2012

if you want to prevent damage then you need to set everyone to the same team and then deal out all the damage via script.
When the server receives OnPlayerTakeDamage, that means that the player has already taken the damage, it's not something you can interrupt because the server doesn't know if a bullet is going to hit another player until the clients report it