From 1895c071c2515394ae53a9371be6ec2b526eaa98 Mon Sep 17 00:00:00 2001 From: Vaqtincha Date: Wed, 5 May 2021 23:30:48 +0500 Subject: [PATCH] send StatusIcon to player (for visual information) works with mp_respawn_immunity_effects 1 --- regamedll/dlls/player.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index c2a7916e2..7b15a1d17 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -10086,6 +10086,14 @@ void EXT_FUNC CBasePlayer::__API_HOOK(SetSpawnProtection)(float flProtectionTime { pev->rendermode = kRenderTransAdd; pev->renderamt = 100.0f; + + MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pev); + WRITE_BYTE(STATUSICON_FLASH); + WRITE_STRING("suithelmet_full"); + WRITE_BYTE(0); + WRITE_BYTE(160); + WRITE_BYTE(0); + MESSAGE_END(); } CSPlayer()->m_flSpawnProtectionEndTime = gpGlobals->time + flProtectionTime; @@ -10105,6 +10113,11 @@ void CBasePlayer::__API_HOOK(RemoveSpawnProtection)() pev->renderamt = 255.0f; pev->rendermode = kRenderNormal; } + + MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, nullptr, pev); + WRITE_BYTE(STATUSICON_HIDE); + WRITE_STRING("suithelmet_full"); + MESSAGE_END(); } CSPlayer()->m_flSpawnProtectionEndTime = 0.0f;