What is the difference between OnPlayerTakeDamage and OnPlayerGiveDamage
#1

If the sync has been updated so it is truely just skin hit, what is the difference between these callbacks in 0.3z?
Reply
#2

>Take
>Give
Reply
#3

It's not deleted ping, it's only compensation via math functions
Reply
#4

Hackers can spoof OnPlayerGiveDamage, making it so they can kill other players without even shooting them, however they can't spoof OnPlayerTakeDamage. Clients can't be trusted.

Here's an extract from the wiki:

Note: One thing you can do with GiveDamage is detect when other players report that they have damaged a certain player, and that player hasn't taken any health loss. You can flag those players as suspicious.
You can also set all players to the same team (so they don't take damage from other players) and process all health loss from other players manually.

You might have a server where players get a wanted level if they attack Cop players (or some specific class). In that case you might trust GiveDamage over TakeDamage.

There should be a lot you can do with it. You just have to keep in mind the levels of trust between clients. In most cases it's better to trust the client who is being damaged to report their health/armour (TakeDamage). SA-MP normally does this. GiveDamage provides some extra information which may be useful when you require a different level of trust.
Reply
#5

You have bodypart detection. Headshots anyone?
Reply
#6

takedamage can be spoofed it just uses the player who got shot instead of the shooter, but I understand your point.
Reply
#7

Quote:
Originally Posted by SPAWN_METAL
Посмотреть сообщение
It's not deleted ping, it's only compensation via math functions
How do you know? Id rather say hitdetection moved to the client side (because people are explicitly talking about "skin hits"), calculating all the arm/leg movements on the server would be way too complicated.
In that case its still not deleted ping, but youre shooting at a slightly older version of the player. Depending on his ping he might see you shooting somewhere else but he still takes damage.

There might be a time difference between Take and GiveDamage now, at least if the server waits for a confirmation from the player who should take damage.
Reply
#8

Just like it's mentioned on the Wiki page, "OnPlayerGiveDamage" gets called when the player gives any sort of damage to the player. It doesn't matter even if the opponent got any damage or not, but this gets called according to the accurate shots or damage given by the player1.

"OnPlayerTakeDamage" gets called whenever the player2 gets damaged, either by player1 or by any circumstances. On the versions below 0.3z, perfect shots would be called under "OnPlayerTakeDamage" only as "OnPlayerGiveDamage" may or may not include lag-shots. As lag-shots are no more in 0.3z, it will go almost the same, however I still think "OnPlayerTakeDamage" can be used to detect if player is getting damaged as there's some bullet matters too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)