SA-MP Forums Archive
[Include] OnPlayerDamage(with HealthLost and ArmourLost) 0.3d - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] OnPlayerDamage(with HealthLost and ArmourLost) 0.3d (/showthread.php?tid=285823)



OnPlayerDamage(with HealthLost and ArmourLost) 0.3d - wups - 25.09.2011

OnPlayerDamage include v3


v3: include renamed to OnPlayerDamage, added OnPlayerGiveDamage.

Find your callback
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
Replace with
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:HealthLost, Float:ArmourLost, weaponid)
Find your callback
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
Replace with:
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:HealthLost, Float:ArmourLost, weaponid)
And of course, include this on top:
pawn Код:
#include <OPTDex>
Download:
Version 3.0 HERE
Version 2.0: HERE
Version 1.1: HERE

Enjoy!
Haven't tested it well, because not using 0.3d ATM.


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - Markx - 25.09.2011

Awesomeee ^^


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - iPLEOMAX - 25.09.2011

wups, I got shot!

I'll check it out, Nice work.


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - Kar - 25.09.2011

Pastebin please?


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - Cypress - 25.09.2011

Quote:
Originally Posted by Kar
Посмотреть сообщение
Pastebin please?
http://pastebin.com/pzr2xNxt


I will test it right now. Good job, thanks.


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - IstuntmanI - 25.09.2011

Another great include from you, well done.

I hope this is working. xD


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - TheArcher - 25.09.2011

If i understand, it will show how many HP and Armour the player pointed lost?


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - MP2 - 25.09.2011

This is a really inefficient way of doing it. With some maths you can easily work it out from 'amount'.


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - [HiC]TheKiller - 25.09.2011

This is a really cool idea but I really don't see the point of the timer. You can track the last damage taken with that callback rather then a constant 1 second timer looping around every player.


Re: OnPlayerTakeDamage(with HealthLost and ArmourLost) 0.3d - wups - 25.09.2011

Quote:
Originally Posted by MP2
Посмотреть сообщение
This is a really inefficient way of doing it. With some maths you can easily work it out from 'amount'.
I don't think so. The health could be 120 and armour 10. How would you calculate that?

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
This is a really cool idea but I really don't see the point of the timer. You can track the last damage taken with that callback rather then a constant 1 second timer looping around every player.
Then the first time player gets damaged will go wrong.
Maybe i should try binding to SetPlayerHealth/Armour.