Jump to content

onClientPlayerDamage Event - when someone else is damaged


Phat Looser

Recommended Posts

Posted

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.

Posted

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.

Posted

Maybe this event is triggered only when player is streamed in? Otherwise it wouldn't be possible to make scripts that cause damage in shooter's, not victim's side.

Posted

I want to make an RPG script without sync issues, i.e. when someone is hit with an katana, the one who hit him gets his wanted level increased.

At the moment it is almost completely random if you hit him or not, especially when you drive a car through a crowded area.

Posted

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".

Posted
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.

Posted
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.

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...