//call medicThis inside` "Player.cpp"`.
void CBasePlayer::MedicToogle(void)
{
CSprite * m_pCall = NULL;
if (gpGlobals->time < m_flCounter)
{
return;
}
//const Vector Position = pev->origin + Vector(0, 45, 0);
switch (RANDOM_LONG(1, 2))
{
case 1:
EMIT_SOUND(ENT(pev), CHAN_VOICE, "speech/saveme1.wav", 1, ATTN_NORM);
m_flCounter = gpGlobals->time + 3.5;
break;
case 2:
EMIT_SOUND(ENT(pev), CHAN_VOICE, "speech/saveme2.wav", 1, ATTN_NORM);
m_flCounter = gpGlobals->time + 3.5;
break;
}
if (m_pCall == NULL)
{
m_pCall = CSprite::SpriteCreate("sprites/saveme.spr", Vector(0, 0, 45), TRUE);
if (m_pCall)
{
m_pCall->SetTransparency(kRenderTransAdd, 255, 255, 255, 255, kRenderFxNoDissipation);
m_pCall->SetAttachment(edict(), 1);
m_pCall->SetScale(0.5);
m_pCall->TurnOn();
m_pCall->AnimateAndDie(20.0f); // different framerates = more visual variation
}
}
}
Thing is that I'm using a sprite called
"saveme.spr"
, from the TFC files, and it doesn't work as it should. This one remains invisible and does not appear, try with other sprites and most of them did appear when pressing the key, from what I understand, there's some sprites that must be added in a different way, like the "voiceicon.spr"
, so I wanted to know If any of you have any ideas and can tell me about this problem.I'll wait for your answers.