Give the same functionality for the alive players to the dead players
As the title says i want to spawn a dead player but the player remains dead for example when all of the player teammates are officially dead the round ends even if the dead player is still alive.
I tried spawning the player and giving him the dead_dead flag but i assume the player functionality is changed on player think and the player returns to the dead spectating. |
Re: Give the same functionality for the alive players to the dead players
As I check in gamerules.cpp, it don't have to be DEAD_DEAD to trigger round end, only need to be not DEAD_NO.
Maybe try DEAD_DYING or DEAD_RESPAWNABLE after spawn? Reference
Spoiler
|
Re: Give the same functionality for the alive players to the dead players
Quote:
|
Re: Give the same functionality for the alive players to the dead players
Quote:
I mean "anything other than DEAD_NO will count as DEAD and will treat it as dead player." You said you set DEAD_DEAD and it turn player back to spec so I thought changing to DEAD_RESPAWNABLE will work. |
Re: Give the same functionality for the alive players to the dead players
I found a solution i need to be able to hook PlayerDeathThink and block it for that specified player.
PHP Code:
|
Re: Give the same functionality for the alive players to the dead players
Hook CHalfLifeMultiplay::CheckWinConditions and check the number of alive players, excluding the ones who are supposed to be dead, then force the round to end. To finish the round, you'll need TerminateRound, you won't even need to hook that with orpheu, it can be implemented in amxx, it's just three lines.
https://github.com/s1lentq/reapi/blo...merules.h#L698 If using regamedll and reapi, there is RG_CSGameRules_CheckWinConditions and rg_round_end native. There are two alternatives I can think of right now if you're not able to use orpheu at all to get the signature for CheckWinConditions. You will do that same check Quote:
The other is to either set a loop task or create an entity and there do that check. To check if the round is not already ending you can use m_bRoundTerminating. To show the player as dead in the scoreboard, hook ScoreAttrib and set the flag (1<<0), you don't need DEAD_DEAD. There is also this plugin which does exactly what you are trying, you may want to check it. https://forums.alliedmods.net/showth...1851?p=1441851 |
Re: Give the same functionality for the alive players to the dead players
i managed for it to work using this sequence of code
Code:
|
Re: Give the same functionality for the alive players to the dead players
Quote:
Its because on player think post the player is thought dead and most of the alive functions are ignored. |
Re: Give the same functionality for the alive players to the dead players
New error there's a problem with switching weapons if anyone can post the function of switching weapons or deploying them because i can't find it.
The problem is when switching a weapon the holster weapon is been deployed again, the dead flag is some how preventing the new weapon from been deployed, i searched the SelectItem in player.cpp but I couldn't find anything useful. |
Re: Give the same functionality for the alive players to the dead players
Quote:
Solved, by setting the player dead_flag to dead_no and re-executing the weapon selection then setting back the player to dead_respawn in client_command forward, the same thing for dropping the weapons. |
All times are GMT -4. The time now is 22:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.