13.02.2013, 23:29
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.
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.