Posts: 737
Threads: 338
Joined: Jan 2013
Hi,
I want to ask.
1. When somebody do damage to somebody then always this callback get called right?
2. It'is possible, that this callback will be called later after when damage was did? i mean player HP change, and after some seconds this callback get's called
Posts: 639
Threads: 92
Joined: Jul 2011
Reputation:
0
1) Yes, each time a player reduces another player's healh.
2) Your wording for this question is unusual, could you reword it?
Posts: 737
Threads: 338
Joined: Jan 2013
I mean it'is possible that this callback can be called later after shoot?
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
1 - Yes.
2 - Yes, if your attempting to make an anti health hacks system with this then you will have problems with the player lagging.
Posts: 887
Threads: 251
Joined: Jun 2011
Reputation:
0
You can't, this callback is called every time a player gives damage to another player in any kind of way.
Posts: 737
Threads: 338
Joined: Jan 2013
Then how to avoid this? yes am doing anti-cheat, and i very important i need in this callback getplayerhealth and then it'is important that player HP after some time change. Because you know if you get player health in this callback you get HP how much player have now. And after some time HP get changes, by amount.
Posts: 887
Threads: 251
Joined: Jun 2011
Reputation:
0
Then make a timer between each shot,I can barely understand you.
Posts: 3,085
Threads: 37
Joined: Nov 2012
Reputation:
0
There is OnPlayerGiveDamage, called when a player physically hurts another player through the use of weapons etc.
Then there is OnPlayerTakeDamage, called whenever a player is physically damaged, whether it be through falling, explosions, vehicles etc.
I think you may be looking for the second option.
Posts: 115
Threads: 4
Joined: Nov 2012
Reputation:
0
if you want to make an Anti-Cheat, then try to use the callback OnPlayerUpdate ^^
Posts: 2,698
Threads: 37
Joined: Mar 2012
Reputation:
0
Since 0.3z, the callbacks are called in such an order:
- OnPlayerWeaponShot - This is called first whenever a player shoots.
- OnPlayerGiveDamage - OnPlayerGiveDamage is being called when player gives damage. It gets called for the player when that player damages other player in-game. It doesn't mean that the damage had been received by the other player.
- OnPlayerTakeDamage - This is called whenever the player takes damage or when a damage is received. There can be a chance where HP may not be changed but through my experiences using this callback, it's always called when player takes damage or when a hit is synchronized.
If you're thinking about anti-health cheats, you must also make sure that HP related functions are always hooked. Otherwise you might encounter false detections.
Posts: 737
Threads: 338
Joined: Jan 2013
It doesn't mean that the damage had been received by the other player. How to understand it? i mean, that sometimes, player can not lose HP? maybe just need to check if amount is bigger then amount > 1, then check?