Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Running the server ➜ help with a new command

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.


7,071 views.

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

Go to topic:           Search the forum


[Go to top] top

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