Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. proc(_updatethebar, @p,
  2. if(!array_contains(all_players(),@p)) {
  3. if(entity_type(@p) == PLAYER) {
  4. @p = get_player_from_entity_id(@p)
  5. }
  6. }
  7. if(array_contains(all_players(),@p)) {
  8. @char = _getchar(@p)
  9. if(@char[showdamage] >= 0) {
  10. if(time() - @char[attacking][1] <= 10000 && is_entity_living(@char[attacking][0])) {
  11. @barhealth = 100
  12. @barmax = 100
  13. @barname = ''
  14. if(entity_type(@char[attacking][0]) == PLAYER) {
  15. @barname = get_player_from_entity_id(@char[attacking][0])
  16. @barchar = _getchar(@barname)
  17. @barhealth = @barchar[health]
  18. @barmax = @barchar[maxhealth]
  19. @barname = pinfo(@barname,4)
  20. @perchealth = @barhealth / @barmax * 100
  21. } else {
  22. _updatemobhealth(@char[attacking][0])
  23. @mobname = get_mob_name(@char[attacking][0])
  24. if(length(@mobname) > 0) {
  25. @barname = @mobname
  26. } else {
  27. @barname = _pretty(entity_type(@char[attacking][0]))
  28. }
  29. @perchealth = get_entity_health(@char[attacking][0])
  30. @barmax = get_max_health(@char[attacking][0])
  31. @barhealth = integer(@barmax * @perchealth / 100)
  32. }
  33. if(@perchealth / 100 == 0) {
  34. if(has_pbar(@p)) {
  35. remove_pbar(@p)
  36. }
  37. } else {
  38. update_pbar(@p,@barname.' '.@barhealth.'/'.integer(@barmax),@perchealth / 100)
  39. }
  40. } else {
  41. if(has_pbar(@p)) {
  42. remove_pbar(@p)
  43. }
  44. }
  45. } else {
  46. if(has_pbar(@p)) {
  47. remove_pbar(@p)
  48. }
  49. }
  50. }
  51. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement