bank.c:126: error: structure has no member named `balance'
ch->gold -= amount;
ch->pcdata->balance += amount; <-- line 126
set_char_color( AT_PLAIN, ch );
ch_printf( ch, "You deposit %d gold.\n\r", amount );
snprintf( buf, MAX_STRING_LENGTH, "$n deposits %d gold.\n\r", amount );
act( AT_PLAIN, buf, ch, NULL, NULL, TO_ROOM );
save_char_obj( ch );
return;
}
bank.c:177: error: structure has no member named `balance'
bank.c:181: error: structure has no member named `balance'
if ( !str_cmp( arg1, "all" ) )
amount = ch->pcdata->balance; <-- line 177
else
amount = atoi( arg1 );
if( amount > ch->pcdata->balance ) <--- line 181
{
a few more all pointing out to pcdata->balance..
------------------------------------------------------------
I followed these instructions:
1. To install this code:
Copy bank.c and bank.h to your src directory. Add bank.c, bank.h
and bank.o to the appropriate sections in your Makefile.
2. In mud.h, find the pc_data structure, and add the following to it:
int balance;
Find the following:
#define LEVEL_HIGOD LEVEL_GOD
and after it add: #include "bank.h"
find the ACT flags for mobiles, and define
ACT_BANKER using an available slot.
3. In save.c, function fwrite_char, find the following line:
fprintf( fp, "Favor %d\n", ch->pcdata->favor );
Add the following line below it:
fprintf( fp, "Balance %d\n", ch->pcdata->balance );
Locate function load_char_obj, find the following line:
ch->pcdata->wizinvis = 0;
Add the following line below it:
ch->pcdata->balance = 0;
Locate function fread_char, find the following line:
KEY( "Bamfin", ch->pcdata->bamfin, fread_string_nohash( fp ) );
Add the following line above it:
KEY( "Balance", ch->pcdata->balance, fread_number( fp ) );
4. In build.c, find the act_flags for mobs, and add "banker" in the
spot corresponding to the new ACT_BANKER flag you defined in mud.h.
5. Make the appropriate additions to tables.c for
do_balance, do_withdraw, and do_deposit.
6. Add the text from bank.help to your help.are file.
7. Make clean, then recompile.
8. Create commands for balance, deposit, and withdraw.
9. Set the banker flag on a mob of your choice.
|