Question
#1

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
Reply
#2

Something like this? https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
Reply
#3

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
Reply
#4

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).
Reply
#5

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 ??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)