Seek Help
Uhm die?
Or just see how many files you got in your folder with right click, properties
Or just see how many files you got in your folder with right click, properties
<img src='http://i9.tinypic.com/2vs292h.jpg' border='0' alt='user posted image' />
Microsoft included the feature to read the ammount of aresden and elvine on folder properties? :huh:NeukenInDeKeuken wrote: Or just see how many files you got in your folder with right click, properties
====<span style='color:red'><br>Aryes</span><br>====<br><br>HB United: www.hbuonline.net:<br><br><img src="http://hbtop50.com/button.php?u=hbkhispano" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=dcom" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=tinchocba" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=rafha_bernn" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=HB-Tere" alt="Helbreath Top 50 - Helbreath Silver" border="0" /><br><img src="http://hbtop50.com/button.php?u=Kiruku" alt="Helbreath Top 50 - Helbreath Silver" border="0" />
One algorithm to achieve this could be like this,arcasok wrote: wat is the code or which function i can get it?
to get the total number of elvines and aresdens
(Note! not the total number of player in server)
thks very much
- Set Aresdens counter to 0.
- Set Elvines counter to 0.
- Loop from 1 to 255 (I)
- Open ascii folder "AscII" + I
- Count number of files in the folder ©
- Loop from 1 to C
- open next file
- parse it (perhaps like the gameserver does, or whatever way you prefer)
- get "character-location" from the chr data file.
- if it is aresden/arehunter: Aresdens++
- if it is elvine/elvhunter: Elvines++
- close file
-----
- close folder
-----
done!
Lol, Im tired..didn't really read the question..thought he ment elv+aresAryes wrote:Microsoft included the feature to read the ammount of aresden and elvine on folder properties? :huh:NeukenInDeKeuken wrote: Or just see how many files you got in your folder with right click, properties
><
<img src='http://i9.tinypic.com/2vs292h.jpg' border='0' alt='user posted image' />
Oh I see. That's even easier.
void CGame::CountSides(int* aresdens, int* elvines) {
register int i;
for (i = 1; i < DEF_MAXCLIENTS; i++) {
if (m_pClientList != NULL) {
if (memcmp(m_pClientList->m_cLocation, "are", 3) == 0) {
*aresdens++;
} else if (memcmp(m_pClientList->m_cLocation, "elv", 3) == 0) {
*elvines++;
}
}
}
Only thing you need to do is add a command and call the method above like this:
int aresdenCount = 0;
int elvineCount = 0;
CountSides(&aresdenCount, &elvineCount);
wsprintf(G_cTxt, "Aresdens: %d Elvines: %d");
Then just print G_cTxt to whereever you want.
void CGame::CountSides(int* aresdens, int* elvines) {
register int i;
for (i = 1; i < DEF_MAXCLIENTS; i++) {
if (m_pClientList != NULL) {
if (memcmp(m_pClientList->m_cLocation, "are", 3) == 0) {
*aresdens++;
} else if (memcmp(m_pClientList->m_cLocation, "elv", 3) == 0) {
*elvines++;
}
}
}
Only thing you need to do is add a command and call the method above like this:
int aresdenCount = 0;
int elvineCount = 0;
CountSides(&aresdenCount, &elvineCount);
wsprintf(G_cTxt, "Aresdens: %d Elvines: %d");
Then just print G_cTxt to whereever you want.
i edited the code u gave me
void CGame::CountSides(int* aresdens, int* elvines) {
register int i;
for (i = 0; i < DEF_MAXCLIENTS; i++) {
if (m_pClientList != NULL) {
if (memcmp(m_pClientList->m_cLocation, "are", 3) == 0) {
*aresdens++;
} else if (memcmp(m_pClientList->m_cLocation, "elv", 3) == 0) {
*elvines++;
}
}
}
then in the game.h i add void CountSides(int* aresdens, int* elvines);
my command function is
if (memcmp(cp, "/who", 4) == 0) {
int aresdenCount = 0;
int elvineCount = 0;
CountSides(&aresdenCount, &elvineCount);
char who[100];
wsprintf(who,"Total players connected: %d. Aresden: %d. Elvine: %d.",WORD)m_iTotalGameServerClients,aresdenCount,elvineCount);
}
is there anything wrg?
void CGame::CountSides(int* aresdens, int* elvines) {
register int i;
for (i = 0; i < DEF_MAXCLIENTS; i++) {
if (m_pClientList != NULL) {
if (memcmp(m_pClientList->m_cLocation, "are", 3) == 0) {
*aresdens++;
} else if (memcmp(m_pClientList->m_cLocation, "elv", 3) == 0) {
*elvines++;
}
}
}
then in the game.h i add void CountSides(int* aresdens, int* elvines);
my command function is
if (memcmp(cp, "/who", 4) == 0) {
int aresdenCount = 0;
int elvineCount = 0;
CountSides(&aresdenCount, &elvineCount);
char who[100];
wsprintf(who,"Total players connected: %d. Aresden: %d. Elvine: %d.",WORD)m_iTotalGameServerClients,aresdenCount,elvineCount);
}
is there anything wrg?
arcasok wrote: i edited the code u gave me
(...)
is there anything wrg?
Code: Select all
if (memcmp(cp, "/who", 4) == 0) {
int aresdenCount = 0;
int elvineCount = 0;
CountSides(&aresdenCount, &elvineCount);
char who[100];
wsprintf(who,"Total players connected: %d. Aresden: %d. Elvine: %d.",WORD) m_iTotalGameServerClients,aresdenCount,elvineCount);
}
Also, that character array containing the "Total players connected: %d. Aresden: %d. Elvine: %d" is not printed to anything yet (perhaps you might want to send it to the client? Or print it to a log file?
the "WORD)" actually is copied error....in my code is"(WORD)"
And one thing mind i ask....izzit this command line should print it to the client?
wsprintf(who,"Total players connected: %d. Aresden: %d. Elvine: %d.",(WORD)m_iTotalGameServerClients,aresdenCount,elvineCount)
let assuming there is only 1 player..
Becoz in game i execute the command it gave me the following result
"Total players connected: 1 ,Aresden: 0. Elvine: 0."
like u mentioned i should print the array on a log file or client?
can u show me how to print it to the client?
thks
And one thing mind i ask....izzit this command line should print it to the client?
wsprintf(who,"Total players connected: %d. Aresden: %d. Elvine: %d.",(WORD)m_iTotalGameServerClients,aresdenCount,elvineCount)
let assuming there is only 1 player..
Becoz in game i execute the command it gave me the following result
"Total players connected: 1 ,Aresden: 0. Elvine: 0."
like u mentioned i should print the array on a log file or client?
can u show me how to print it to the client?
thks
oh...i have another function before the "/who" command function end
ShowNotice(iClientH,who);
void CGame::ShowNotice(int iClientH,char *pMsg)
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, pMsg);
}
and i think this is the function tat print the array on the client.
So i think is something wrg in the code u gave me....NEED ur HELP =)
ShowNotice(iClientH,who);
void CGame::ShowNotice(int iClientH,char *pMsg)
{
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_NOTICEMSG, NULL, NULL, NULL, pMsg);
}
and i think this is the function tat print the array on the client.
So i think is something wrg in the code u gave me....NEED ur HELP =)
Use your ShowNotice to print it to the client.arcasok wrote: the "WORD)" actually is copied error....in my code is"(WORD)"
And one thing mind i ask....izzit this command line should print it to the client?
wsprintf(who,"Total players connected: %d. Aresden: %d. Elvine: %d.",(WORD)m_iTotalGameServerClients,aresdenCount,elvineCount)
let assuming there is only 1 player..
Becoz in game i execute the command it gave me the following result
"Total players connected: 1 ,Aresden: 0. Elvine: 0."
like u mentioned i should print the array on a log file or client?
can u show me how to print it to the client?
thks
Also, 1 player but no aresden/elvine would mean that it was a traveller?