SA-MP Forums Archive
Adjusting Player Take Damage - 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: Adjusting Player Take Damage (/showthread.php?tid=662936)



Adjusting Player Take Damage - Novacaine - 16.01.2019

Hi everyone,

I'm trying to make a defence stat point system. System is simply, the higher defence stats you have, less damage you get. But I couldn't control the damage player took. I'm using weapon-config inc. But couldn't figure out. I used OnPlayerDamage public. But nothing happened. It's not calling when player taking damage. How can i made it up?


Re: Adjusting Player Take Damage - Hunud - 16.01.2019

Some things are better in weapon-config you may do, but also you can do something like that.

Code:
new Float:hp;
GetPlayerHealth(playerid, hp);
amount -= (amount/100) * 15;
SetPlayerHealth(playerid, hp - amount);
This will take only a *15 from the health.