notgoodusename/OsirisAndExtra

When i use the clantag it lags like crazy

Closed this issue · 3 comments

When i use the clantag it lags like crazy

clantag updates too quickly then

clantag updates too quickly then

How do i fix?

My code:
static float lastTime = 0.0f;
float currentTime = memory->globalVars->currenttime * 1.0f;

    if (lastTime != currentTime)
    {
        std::string buf = ClanTags[(int)currentTime % ClanTags.size()];
        memory->setClanTag(buf.c_str(), buf.c_str());
        lastTime = currentTime;
    }

basically u multiply currenttime by 1, making it still the same value.

static float lastTime = 0.0f;

if (memory->globalVars->realtime - lastTime < 0.6f)
    return;
 
lastTime = memory->globalVars->realtime;
std::string buf = ClanTags[static_cast<int>(lastTime * 10) % ClanTags.size()];
memory->setClanTag(buf.c_str(), buf.c_str());