Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc(_updatethebar, @p,
- if(!array_contains(all_players(),@p)) {
- if(entity_type(@p) == PLAYER) {
- @p = get_player_from_entity_id(@p)
- }
- }
- if(array_contains(all_players(),@p)) {
- @char = _getchar(@p)
- if(@char[showdamage] >= 0) {
- if(time() - @char[attacking][1] <= 10000 && is_entity_living(@char[attacking][0])) {
- @barhealth = 100
- @barmax = 100
- @barname = ''
- if(entity_type(@char[attacking][0]) == PLAYER) {
- @barname = get_player_from_entity_id(@char[attacking][0])
- @barchar = _getchar(@barname)
- @barhealth = @barchar[health]
- @barmax = @barchar[maxhealth]
- @barname = pinfo(@barname,4)
- @perchealth = @barhealth / @barmax * 100
- } else {
- _updatemobhealth(@char[attacking][0])
- @mobname = get_mob_name(@char[attacking][0])
- if(length(@mobname) > 0) {
- @barname = @mobname
- } else {
- @barname = _pretty(entity_type(@char[attacking][0]))
- }
- @perchealth = get_entity_health(@char[attacking][0])
- @barmax = get_max_health(@char[attacking][0])
- @barhealth = integer(@barmax * @perchealth / 100)
- }
- if(@perchealth / 100 == 0) {
- if(has_pbar(@p)) {
- remove_pbar(@p)
- }
- } else {
- update_pbar(@p,@barname.' '.@barhealth.'/'.integer(@barmax),@perchealth / 100)
- }
- } else {
- if(has_pbar(@p)) {
- remove_pbar(@p)
- }
- }
- } else {
- if(has_pbar(@p)) {
- remove_pbar(@p)
- }
- }
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement