Phat Looser Posted January 7, 2009 Share Posted January 7, 2009 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
50p Posted January 7, 2009 Share Posted January 7, 2009 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
DiSaMe Posted January 7, 2009 Share Posted January 7, 2009 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. Link to comment
Phat Looser Posted January 8, 2009 Author Share Posted January 8, 2009 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. Link to comment
50p Posted January 8, 2009 Share Posted January 8, 2009 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 Posted January 8, 2009 Author Share Posted January 8, 2009 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
therenex Posted January 9, 2009 Share Posted January 9, 2009 but those are sync issues from MTA itself, you can't really do much about it. Link to comment
DiSaMe Posted January 9, 2009 Share Posted January 9, 2009 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
therenex Posted January 9, 2009 Share Posted January 9, 2009 You don't actually hit him, the guy gets hit by you. Contradictory, isn't it ? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now