Gammon Forum
Entire forum
ROM
Running the server
help with a new command
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Tidus
(11 posts) 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;
}
| 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.
6,401 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.