Remove "DEAD" flag
Hi, I've been going thru some issues with my latest code, I'm unable to remove the 'DEAD' flag from scoreboard for some reason, and I'm trying to do something: When Player1 infects Player2 it should show up in the kill-feed like this:
Player1 ☠️ Player2 or Player1 ☠️ Player2 Player2 color depending on his team, but instead it's always showing: Player1 ☠️ Player2 PS: TEAM_MONSTER == 2 (TEAM_CT) PHP Code:
|
Re: Remove "DEAD" flag
Here's the answer on how to solve the issues in case someone needs them since nobody helped me:
1. All I had to do to remove the "DEAD" flag was change MSG_ALL to MSG_BROADCAST for some reason. 2. Creating a 0.1s task after sending Infection Message and then changing the player team inside the task will make it work, the reason: When you send infection message it is called twice, not sure about the in-between delay of the messages though. So: • Attacker is CT, victim is T • You send infection message • Right message is sent, CT attacker kills T victim • Victim team is changed to CT • Message is sent again with changed teams (both CT) That's why it always showed victim team CT. |
Re: Remove "DEAD" flag
Thanks for posting your solution. FWIW, I did try but it was not working for me so I didn't bother to reply. I dug up this thread which was of no help.
|
Re: Remove "DEAD" flag
Quote:
I'm still not sure what's causing it to get called twice though. |
Re: Remove "DEAD" flag
What do you mean by twice
|
Re: Remove "DEAD" flag
Quote:
|
Re: Remove "DEAD" flag
InfectionMsg() does not trigger the actual DeathMsg event..if you hook DeathMsg and call InfectionMsg(), DeathMsg is not called. I would need to see more of your code.
|
Re: Remove "DEAD" flag
Quote:
So what's the reason I have to set a 0.1 second delay to make it work properly? When I don't set a 0.1s delay it shows always CT, but when I set a 0.1s delay, it shows the right team. Works: PHP Code:
PHP Code:
|
Re: Remove "DEAD" flag
Things don't happen instantly, so DeathMsg is likely processed by the game after the team change you made. Setting the task delays the team change after DeathMsg was sent.
|
Re: Remove "DEAD" flag
Quote:
|
| All times are GMT -4. The time now is 07:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.