[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  ROM
. -> [Folder]  Running the server
. . -> [Subject]  help with a new command
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

help with a new command

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Tidus   (11 posts)  [Biography] bio
Date Tue 27 Apr 2004 04:04 PM (UTC)
Message
I have put in a plist command which is a variation of a snippet I found not too long ago. It displays everyone in the player directory and it used to also display thier warpoints next to thier name but one day it started only displaying my own warpoints next to everyone else's name. I am not sure what is wrong with it. I have attached a copy of the function here, if anyone could please help me that would be great.

void do_plist( CHAR_DATA *ch, char *argument )
{
DIR *dp;
struct dirent *ep;
char buf[80];
char buffer[MAX_STRING_LENGTH*4];
bool is_playing = FALSE;
bool ploaded = FALSE;
CHAR_DATA *victim;


dp = opendir ("../player");


if (dp != NULL)
{

while ( (ep = readdir (dp)))
{
if ( ep->d_name[0] == '.' )
continue;

for(victim = char_list;victim != NULL;victim = victim->next)
{


{
if(IS_NPC(victim))
continue;
if(is_name(victim->name, ep->d_name))
break;


}



if ( victim == NULL )
{
victim = pload(ep->d_name);
ploaded = TRUE;
is_playing = FALSE;
}
else
{
is_playing = TRUE;
ploaded = FALSE;
}


sprintf( buf, "%-15s %4d\n\r",
ep->d_name, victim->warpoints);
strcat( buffer, buf );
}

if(ploaded)
punload(victim);
}

closedir (dp);
}

else
perror ("Couldn't open the directory");

page_to_char( buffer, ch );

return;
}

[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,103 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]