Is there any situation in which OnPlayerGiveDamage is called but OnPlayerTakeDamage is not?
#1

Hi, I think that more or less I know a bit of what the difference between these two callbacks is, and generally I tend to use OnPlayerTakeDamage in my scripts rather than the other callback. However, my doubt comes because I don't know if there are any particular situations in which OnPlayerGiveDamage is called while OnPlayerTakeDamage is not. For example I don't know if OnPlayerGiveDamage may be called when shooting a player of your own team (while team damage is disabled), or when you shoot to another player without lag-aiming (I mean when you see that green marker over him, but he's not actually receiving your shots).
I have read the wiki article: https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage which gives some tips about this, but still I don't have it fully clear.
Reply
#2

its all due becouse of lag.
one 1 players screen he will shoot which will call OnPlayerGiveDamage but on the other player if they are lagging then OnPlayerTakeDamage will not get called because they never received the Damage to them nothing happened.

As it says its better to trust the client that its being damaged rather then the other way around..
So its really tricky to play with those two.
Reply
#3

By the way, do you know if OnPlayerGiveDamage is called when you attack a player that has health hack/toggle?
Reply
#4

Quote:
Originally Posted by Gryphus One
View Post
By the way, do you know if OnPlayerGiveDamage is called when you attack a player that has health hack/toggle?
Nope it doesn't, that's what makes it virtually impossible to detect godmode.
Reply
#5

Quote:
Originally Posted by SuperViper
View Post
Nope it doesn't, that's what makes it virtually impossible to detect godmode.
If it isn't called, surely you can use that to your advantage when you know the player should be taking damage?
Reply
#6

Quote:
Originally Posted by PlayLSX_Founder
View Post
If it isn't called, surely you can use that to your advantage when you know the player should be taking damage?
I don't quite understand this: how can you know that a player should be taking damage, and that you aren't just failing at shooting him?
Reply
#7

Players can take damage a multitude of ways, is OnPlayerDamage only called through weapon use? If not then you could use a command on suspected God Mode users to create damage for them, if OnPlayerDamage isn't called then you would know for sure they are invincible/desync, either way I think there is possiblity to use a disadvantage to your advantage
Reply
#8

Quote:
Originally Posted by PlayLSX_Founder
View Post
Players can take damage a multitude of ways, is OnPlayerDamage only called through weapon use?
When player fall or velocity z set to -0.5 call OnPlayerDamage i think also to exist possibility to detect this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)