Experienced Elementalist
- Joined
- Oct 14, 2015
- Messages
- 293
- Reaction score
- 86
Hello area, today I will leave a simple code for you, and a public code but not much explored.
This code will show the total number of players online on the channel.
Remembering I won't give support, because it's something simple.
Let's start.
Open: MMatchChannel.h
Search: struct MCHANNELLISTNODE
Added:
Open: MMatchServer_Channel.cpp
Search: MMatchServer::ChannelList
Added:
Open: ZGameClient.cpp
Search: ZGameClient::OnChannelList
Added:
From within the game interface you add this:
Screenshot:
Credits to: @jetman82
This code will show the total number of players online on the channel.
Remembering I won't give support, because it's something simple.
Let's start.
Open: MMatchChannel.h
Search: struct MCHANNELLISTNODE
Added:
Code:
int nOnlinePlayers;
Open: MMatchServer_Channel.cpp
Search: MMatchServer::ChannelList
Added:
Code:
pNode->nOnlinePlayers = (int)m_Objects.size();
Open: ZGameClient.cpp
Search: ZGameClient::OnChannelList
Added:
Code:
MLabel* pLabel = (MLabel*)pResource->FindWidget("OnlinePlayersLabel");
char szText[128];
sprintf(szText, "Players Online : %d", pNode->nOnlinePlayers);
pLabel->SetText(szText);
From within the game interface you add this:
PHP:
<LABEL item="OnlinePlayersLabel" parent="ChannelListFrame">
<FONT>FONTa10_O2Wht</FONT>
<TEXTCOLOR>
<R>255</R>
<G>255</G>
<B>255</B>
</TEXTCOLOR>
<BOUNDS>
<X>10</X>
<Y>395</Y>
<W>300</W>
<H>24</H>
</BOUNDS>
<TEXT></TEXT>
</LABEL>
Screenshot:
Credits to: @jetman82
Attachments
You must be registered for see attachments list
Last edited: