Skip to content

Commit

Permalink
send StatusIcon to player (for visual information) works with mp_resp…
Browse files Browse the repository at this point in the history
…awn_immunity_effects 1
  • Loading branch information
Vaqtincha committed May 5, 2021
1 parent 71db673 commit 1895c07
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 1895c07

Please sign in to comment.