- Joined
- Jan 6, 2025
- Messages
- 27
- Reaction score
- 3
Hi friends, I'm here to share this little extra feature that could be very useful in games. I think I saw it on a private server, but I can't remember which one. This logic has helped me a lot in gladiator games, so it might be useful to others, or maybe not.
This is called charged massive time.
You may have some flaws, but I'll leave that for those who want to fix them. The code is open and public, and they're free to do whatever they want with it.
This is called charged massive time.
Code:
ZMyCharacter.h
float m_fMassiveDurationTime = 0.0f;
bool m_bIsMassiveActive = false;
Code:
ZMyCharacter.cpp
if (m_bIsMassiveActive) {
m_fMassiveDurationTime += fDelta;
if (m_fMassiveDurationTime >= CHARGED_TIME) {
m_bIsMassiveActive = false;
m_fMassiveDurationTime = 0.0f;
}
}
Code:
paste these on void ZMyCharacter::Charged()
m_bIsMassiveActive = true;
m_fMassiveDurationTime = 0.0f;
Code:
ZCombatInterface.cpp
if (pMyCharacter->m_bIsMassiveActive)
{
char szMassiveInfo[128];
sprintf(szMassiveInfo, "Massive Time: %.2f / %.2f", pMyCharacter->m_fMassiveDurationTime, 15.f);
if (pMyCharacter->m_fMassiveDurationTime < 15.f / 3.0f) {
pDC->SetColor(MCOLOR(0xFFFF0000));
}
else if (pMyCharacter->m_fMassiveDurationTime < 2.0f * 15.f / 3.0f) {
pDC->SetColor(MCOLOR(0xFFFFFF00));
}
else {
pDC->SetColor(MCOLOR(0xFF00FF00));
}
DWORD currentTime = timeGetTime();
if ((currentTime / 500) % 2 == 0) {
TextRelative(pDC, 10.f / 800.f, 195.f / 600.f, szMassiveInfo);
}
}
You may have some flaws, but I'll leave that for those who want to fix them. The code is open and public, and they're free to do whatever they want with it.

