Question - 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: Question (
/showthread.php?tid=613827)
Question -
Zorono - 01.08.2016
Hello Guys, Its Right i can use GetPlayerHealth to detect player's Health but i need one help please Do anyone know how to detect player dealth before someone shoot him and after he got shooted i mean if anyone shooted someone and that guy lost for example 10% i need to detect his health before shoot and after and if he lost more than 50% and his old health was less than 80% then something will happen for example he will recive an message
Please Help Guys i tried more things but all not working
Re: Question -
FreAkeD - 01.08.2016
Something like this?
https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
Re: Question -
Zorono - 01.08.2016
Quote:
Originally Posted by FreAkeD
|
Yes but how can i detect and save his old health before give damage on a string and if player lost more than 50% of his old health will recive an message (for example) please
Re: Question -
SyS - 01.08.2016
Quote:
Originally Posted by Zorono
Yes but how can i detect and save his old health before give damage on a string and if player lost more than 50% of his old health will recive an message (for example) please
|
use GetPlayerHealth function (
link) to store players health (global var default can be added on onplayerspawn).
Use this function again when player take damage (
link)
Now on this call back use another var to store the current health and check it with the global var we used before.
PHP код:
if(second_var==first_var/2)//for 50%
update the first var in the if condition and Show the message you want to show (
link1,
link2).
Re: Question -
Zorono - 01.08.2016
Quote:
Originally Posted by Sreyas
use GetPlayerHealth function ( link) to store players health (global var default can be added on onplayerspawn).
Use this function again when player take damage ( link)
Now on this call back use another var to store the current health and check it with the global var we used before.
PHP код:
if(second_var==first_var/2)//for 50%
update the first var in the if condition and Show the message you want to show ( link1, link2).
|
Nice Idea Sir +repped
but can i use first_var on OnPlayerUpdate ??