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



How? - Rapeassboi - 15.01.2014

How do i do that if i shoot a player he wont loose health it will stay on what his health his im using the OnPlayerShootPlayer function and here is what i've done so far

pawn Код:
GetPlayerHealth(Target, HP);
                    GetPlayerArmour(Target, Armor);
                    SetPlayerHealth(Target, HealthLost+HP);
                    SetPlayerArmour(Target, ArmourLost+Armor);
but he keeps loosing health.


Respuesta: How? - Swedky - 15.01.2014

Do you wish that if a player shoots other one, the health does not go down?

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


Re: How? - Rapeassboi - 15.01.2014

Why in the world would i want to put him in a team, my code is okay but he is still loosing health and i wanna know why and how to fix it


Re: How? - Vince - 15.01.2014

Because SetPlayerTeam disables friendly fire. Teammates can not harm each other in any way.


Re: How? - Rapeassboi - 15.01.2014

I know what it does, as i stated above i want someone to tell me why my code isent working.


Re: How? - Mauzen - 15.01.2014

OnPlayerShootPlayer isnt 100% reliable. Better use OnPlayerTakeDamage for this with the same code: https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage