Experienced Elementalist
- Joined
- Oct 14, 2015
- Messages
- 293
- Reaction score
- 86
Since I was there these days I decided to make this contribution, I made this code for you to add in your sources.
This code shows when live players are inside the room.
Making it even easier for you who likes to give event.
Go to ZCombatInterface.cpp
Go to ZCombatInterface.h
Credit to me for this great idea.
This code shows when live players are inside the room.
Making it even easier for you who likes to give event.
Go to ZCombatInterface.cpp
Code:
Alive(pDC);
Code:
void ZCombatInterface::Alive(MDrawContext* pDC)
{
ZCharacter* pCharacter = GetTargetCharacter();
if (pCharacter == NULL || pCharacter->IsObserverTarget())
return;
char szAlive[64]; // alive
pDC->SetFont(GetGameFont()); // default font
pDC->SetColor(MCOLOR(255, 255, 255)); // color
if (strstr(ZGetGameClient()->GetChannelName(), "Channel (Event)") && ZGetMyInfo()->IsAdminGrade()) // channel
{
int nPlayers = 0;
for (ZCharacterManager::iterator itor = ZGetGame()->m_CharacterManager.begin(); itor != ZGetGame()->m_CharacterManager.end(); ++itor)
{
ZCharacter* pCharacter = (*itor).second;
if (ZGetGame()->GetMatch()->IsTeamPlay())
{
if (!pCharacter->IsDie() && pCharacter->GetTeamID() != ZGetGame()->m_pMyCharacter->GetTeamID())
{
++nPlayers;
}
}
else if (!pCharacter->IsDie() && pCharacter != ZGetGame()->m_pMyCharacter)
{
++nPlayers;
}
}
sprintf(szAlive, "%d Live players in the room", nPlayers);
TextRelative(pDC, 10.f / 800.f, 100.f / 600.f, szAlive);
}
}
Go to ZCombatInterface.h
Code:
void Alive(MDrawContext* pDC);
Attachments
You must be registered for see attachments list
Last edited: