Open SmileYzn opened 1 year ago
https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/dlls/multiplay_gamerules.cpp#L4169-L4170. I think, it could be removed
Removed? No, I think only put at end of playerkilled func
CheckWinConditions() already calls in CBasePlayer::Killed. So, it calls twice at now
That is to check m_iRoundWinStatus and do a InitializePlayerCounts, the twice calls do two different things.
Maybe you should look at https://github.com/alliedmodders/amxmodx/issues/713
I knows that is how game works as explained here.
To fix it, i hooked PlayerKilled as PRE. But in some plugins that do something in PlayerKilled that will be a problem hook it as PRE no?
Also make sense execute CheckWinConditions only after all OnPlayerKilled was executed not only deathMessage itself
how it would do then? checking all the players after playerkilled and then call CheckWinConditions?... CheckWinConditions already does that
I think that the best moment to run that check if after announcing player's death, which it what already does... Trying it to do it later may get weird interactions, like, lets say, another win condition gets called
if you need a better hook when player is "100% dead" and before calling CheckWinConditions, just use the DeathMsg
No, just need call RoundEnd after Player Killed, As said before. I'm using directly reAPI in a metamod plugin.
Anyway i just hooked PlayerKilled as PRE and RoundEnd as POST events, this works
Guys, I am trying to record the damage (hits, dmg, hp) Example: https://forums.alliedmods.net/attachment.php?attachmentid=61669&d=1268878741 via amxx and CBasePlayer_TakeDamage I am hooking it as a POST and everything works okay, but when last enemy dies it doesn't record the dmg like something is called after. Just like smiley said.
If I hook it like a PRE it works, but records incorrect damage sometimes.
I confirm that smiley is right and also I have red all information about how it is called, but when I use it as a PRE the damage is not correctly displayed. Do you guys have some suggestions? Sorry for spam and the bump.
Guys, I am trying to record the damage (hits, dmg, hp) Example: https://forums.alliedmods.net/attachment.php?attachmentid=61669&d=1268878741 via amxx and CBasePlayer_TakeDamage I am hooking it as a POST and everything works okay, but when last enemy dies it doesn't record the dmg like something is called after. Just like smiley said.
If I hook it like a PRE it works, but records incorrect damage sometimes.
I confirm that smiley is right and also I have red all information about how it is called, but when I use it as a PRE the damage is not correctly displayed. Do you guys have some suggestions? Sorry for spam and the bump.
it doesn't record the dmg like something is called after
So, get help on scripting forums because you're having coding issues instead of an specific issue due to the project rewriting.
The behavior of the game is how you can see it right now, in this version and the original one, and it wont be changed in view of not breaking compatibility with 3rd party plugins.
You just need to code the exception to the case when a player is "killed" when round is over, and that's it.
I emphasize with the first point that I explained.
The order of gamerules now is:
PlayerKilled > DeathNotice > CheckWinConditions > TeamExterminationCheck > OnRoundEnd_Intercept
But DeathNotice is called at begin of Playerkilled, That will execute OnRoundEnd before PlayerKilled function ends.
DeathNotice maybe do not need to be the last thing to be called in PlayerKilled function or something else?
Ps. In game logic itself is OK.
But the problem is that RoundEnd always execute Before PlayerKilled in API function if round is won by elimination.
I solved this hokking PlayerKilled as PRE function, but is not a good approach anyway