CLEO Help Relation between weapon damage and HP loss

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I noticed that when I use deagle the enemy sometimes loses 49 hp and sometimes loses 42 hp, what is the reason behind this?
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
monday link said:
I noticed that when I use deagle the enemy sometimes loses 49 hp and sometimes loses 42 hp, what is the reason behind this?

It depends on the amount of weapon damage sent by the server to the client, if server sends 42, then it will be 42.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I checked and it looks like it doesn't matter which part of the body I shoot at. I also noticed that when the enemy's hp is full, one deagle shot takes always 51 hp, i tested it on two different servers and it's the same on both...

Below is the code i used
Code:
{$CLEO .cs}

0000: NOP

:Show_target_health
wait 0
if
0AD2: 0@ = player $PLAYER_CHAR targeted_actor
//If I target someone then he's a player "0@"
jf @Show_target_health
0B2B: samp 1@ = get_player_id_by_actor_handle 0@
0B25: samp 2@ = get_player_health 1@
0B26: samp 3@ = get_player_armor 1@
0B36: samp 4@ = get_player_nickname 1@
0B37: samp 5@ = get_player_color 1@
//Get Info about the player

00A0: store_actor 0@ position_to 10@ 11@ 12@
0B55: convert_3D_coords 10@ Y 11@ Z 12@ to_screen 13@ 14@
//Get his position on screen

03F0: enable_text_draw 1
0D94: draw_text 4@ pos_xy 13@ 14@ align_xy 0.5 0.0 color 5@ shadow 1
14@ -= 15
13@ -= 32
0AD3: 31@v = format "%d" 2@
0D94: draw_text 31@v pos_xy 13@ 14@ align_xy 0.5 0.0 color 0xC21700 shadow 1
13@ += 32
0AD3: 31@v = format "%d" 3@
0D94: draw_text 31@v pos_xy 13@ 14@ align_xy 0.5 0.0 color 0xE3E3E3 shadow 1 
//Draw things over him   
jump @Show_target_health
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
0B25: samp 2@ = get_player_health 1@ is incorect, returns a multiple of 7.

So other players health can only be "0, 7, 14, 21, 28, 35, 42, 49 .. 98"

So that's why the lost health will sometimes display 49 instead of 42.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Before displaying damage text.

Code:
if weapon == 24
then 
    if dmgDone == 49
    then dmgDone -= 3
    end
    if dmgDone == 42
    then dmgDone += 4
    end
    if dmgDone == 51
    then dmgDone -= 5
    end
end

drawText dmgDone
 
Status
Not open for further replies.
Top