OnPlayerTakeDamage Help
#4

GetPlayerHealth doesn't work under OnPlayerGive/TakeDamage because of the way Get...() functions work. Most of them (if not all) get data stored on the SERVER when a client syncs (OnPlayerUpdate); they don't 'query' the client. The problem here is that the new health isn't synced before OnPlayerGive/TakeDamage is called, so GetPlayerHealth etc. won't work.

Perhaps my latest include may assist you: https://sampforum.blast.hk/showthread.php?tid=414939

I guess you just have to GetPlayerHealth and remove 'healthloss' and you'll get the new values. If health-healthloss <= 20 do something.
Reply


Messages In This Thread
OnPlayerTakeDamage Help - by AphexCCFC - 13.02.2013, 22:48
Re: OnPlayerTakeDamage Help - by austin070 - 13.02.2013, 22:54
Re: OnPlayerTakeDamage Help - by AphexCCFC - 13.02.2013, 23:07
Re: OnPlayerTakeDamage Help - by MP2 - 13.02.2013, 23:29
Re: OnPlayerTakeDamage Help - by AphexCCFC - 13.02.2013, 23:36

Forum Jump:


Users browsing this thread: 3 Guest(s)