Jump to content

onClientPlayerDamage Event - when someone else is damaged


Phat Looser

Recommended Posts

Hi there, I wanted to know if there is any possibility to change the call of the onClientPlayerDamage Event in a way it enables me to recognize the damage the other players receive (the small health ups and downs you can see when you shoot at a player).

At the moment, the function called only is called when the own player receives the damage.

Link to comment

You could use setElementData to determine player being hit/shot. But why would you want this for every player client-side? You can use server-side event onPlayerDamage which is triggered for every player. I haven't really tested but are you sure onClientPlayerDamage is triggered only for local player? Sometimes documentation on wiki may be wrong. I used this event for my old script "got_hit" and I checked if the player that was hit/shot is local player. Try it.

Link to comment

Phat Looser, then this script can be made server-side... onPlayerDamage is triggered every time that player is hit (any player). If you want to make a custom wanted level script then you could use triggerClientEvent to show him more "wanted level stars".

Link to comment
Phat Looser, then this script can be made server-side... onPlayerDamage is triggered every time that player is hit (any player). If you want to make a custom wanted level script then you could use triggerClientEvent to show him more "wanted level stars".

The problem is, when I am driving and someone stands nearby, I am dodging him and do NOT hit him on my own computer - sometimes it still adds me wanted level.

This is a bit inconvenient.

Link to comment
Phat Looser, then this script can be made server-side... onPlayerDamage is triggered every time that player is hit (any player). If you want to make a custom wanted level script then you could use triggerClientEvent to show him more "wanted level stars".

The problem is, when I am driving and someone stands nearby, I am dodging him and do NOT hit him on my own computer - sometimes it still adds me wanted level.

This is a bit inconvenient.

It's because you actually hit him because damage is controlled on computer of attacked player.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...