Simply put, your pulling up pArea which isn't initialized. If you want to access the information for the area the player is in, you need to point to the pointer in the CHAR_DATA struct. for example.
ch->pArea->name, ch->pArea->planet this will point to the proper area which the player is currently in, if you haven't fiddled with the code dealing with the CHAR_DATA struct. On a further note, it would be a good idea for you to look through the code before you try to add things in and see how things come together, if you knew how the code works, you would of picked up on this. Your going to have huge problems further down the line if you don't go through and check things out first. i printed out all of the code and went through it and saw how it was built before I even picked up a snipplet or started fiddling with stuff. Go through merc.h and look at all of the structs and check out all of the pointers or your going to have MAJOR headaches. Sincerely, Steven Radziul Creator of the Redkoala MUD Source (Soon to be released) ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, April 24, 2002 9:11 AM Subject: do_where: planets and area name > Hi, > I added a planet script that i found on some snippet > site. It works well and all, but in do_where, i would > like to add to the top: > You are in the Areaname, on planet Planetname. > Players near by: > Soandso Roomname > Soandso2 Roomname2 > etc... > > This code I have right now is as follows: > void do_where( CHAR_DATA *ch, char *argument ) > { > char buf[MAX_STRING_LENGTH]; > char arg[MAX_INPUT_LENGTH]; > CHAR_DATA *victim; > DESCRIPTOR_DATA *d; > bool found; > > one_argument( argument, arg ); > > if ( arg[0] == '\0' ) > { > send_to_char( "Players near you:\n\r", ch ); > found = FALSE; > for ( d = descriptor_list; d; d = d->next ) > > ...it goes on, but thats the main part for what i want > to do. So I changed it as follows: > > void do_where( CHAR_DATA *ch, char *argument ) > { > char buf[MAX_STRING_LENGTH]; > char arg[MAX_INPUT_LENGTH]; > CHAR_DATA *victim; > DESCRIPTOR_DATA *d; > AREA_DATA *pArea; > bool found; > > one_argument( argument, arg ); > > if ( arg[0] == '\0' ) > { > sprintf( buf, "You are in the %s on planet % > s .\n\r", pArea->name, pArea->planet ); > send_to_char( buf, ch); > > send_to_char( "Players near you:\n\r", ch ); > found = FALSE; > for ( d = descriptor_list; d; d = d->next ) > > So what am I doing wrong? Eh..? I do actually have all > the planet code coded in and it works fine. I just am > not sure what to do here. I'm new to code the ROM2.4b6 > code, and MUD code in general, but I was asked to do > this for a friend...if you could help me out here, it > would be great. > > Thanks, > -Mistral > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom

