Welcome to the Builder Academy

Question linkload wiz command - could use alittle help

More
21 Mar 2017 12:46 - 21 Mar 2017 12:50 #6610 by JTP
Found linkload command on circlemud, and trying to get it to Work with tba...

Have solved some of if, but some just wont Work:
Code:
ACMD(do_linkload) { char arg[MAX_INPUT_LENGTH]; char buf[MAX_INPUT_LENGTH]; struct char_data *victim = 0; struct char_file_u tmp_store; one_argument(argument, arg); if (!*arg) { send_to_char(ch, "Linkload who?\r\n"); return; } if (get_player_vis(ch, arg, 0, FIND_CHAR_WORLD)) { send_to_char(ch, "They are already connected!\r\n"); return; } CREATE(victim, struct char_data, 1); clear_char(victim); if (load_char(arg, &tmp_store) > -1) { store_to_char(&tmp_store, victim); if (GET_LEVEL(victim) <= GET_LEVEL(ch)) { sprintf(buf, "(GC) %s has linkloaded %s.", GET_NAME(ch), GET_NAME(victim)); mudlog(buf, BRF, GET_LEVEL(ch) + 1, TRUE); Crash_load(victim); victim->next = character_list; character_list = victim; victim->desc = NULL; char_to_room(victim, IN_ROOM(ch)); act("You linkload $N.", FALSE, ch, 0, victim, TO_CHAR); act("$n linkloads $N.", FALSE, ch, 0, victim, TO_NOTVICT); } else { send_to_char(ch, "Sorry, you aren't godly enough to linkload that char.\r\n"); free_char(victim); } } else { send_to_char(ch, "No such player exists.\r\n"); free(victim); } return; }


act.wizard.c: In function ‘do_linkload’:
act.wizard.c:5394: error: storage size of ‘tmp_store’ isn’t known
act.wizard.c:5411: warning: implicit declaration of function ‘store_to_char’
act.wizard.c:5415: warning: passing argument 1 of ‘mudlog’ makes integer from pointer without a cast
act.wizard.c:5415: warning: passing argument 4 of ‘mudlog’ makes pointer from integer without a cast
act.wizard.c:5394: warning: unused variable ‘tmp_store’
make[1]: *** [act.wizard.o] Error 1


How do i get the rest to Work ?
Last edit: 21 Mar 2017 12:50 by JTP.

Please Log in or Create an account to join the conversation.

More
21 Mar 2017 20:03 #6611 by cunning
look at your error. It clearly tells you the issue. That command set was written for versions way long ago and are no longer used that way. Specifically your mudlog command. I would look that over because BUF is not your first argument in mudlog.

#2. we use ASCII characters, not binary, so store_to_char() is no longer used.

Please Log in or Create an account to join the conversation.

More
21 Mar 2017 21:46 #6614 by JTP
Ok think i fixed mudlog

But what to use instead of store_to_char ?

And what about storage size of tmp_store and unused variable tmp_store ?

Please Log in or Create an account to join the conversation.

More
21 Mar 2017 23:14 - 21 Mar 2017 23:16 #6615 by cunning
You have some things to learn but that's OK. We do not use tmp_store, that is for binary files. We use ASCII files now. You also cannot reference the structure. It is useless since it does not exist. Here is the fix, and all you had to do is search on load_char() and you would have found the answer.

Code:
ACMD(do_linkload) { char arg[MAX_INPUT_LENGTH]; char buf[MAX_INPUT_LENGTH]; struct char_data *victim = NULL: one_argument(argument, arg); if (!*arg) { send_to_char(ch, "Linkload who?\r\n"); return; } if (get_player_vis(ch, arg, 0, FIND_CHAR_WORLD)) { send_to_char(ch, "They are already connected!\r\n"); return; } CREATE(victim, struct char_data, 1); clear_char(victim); CREATE(victim->player_specials, struct player_special_data, 1); new_mobile_data(victim); if ((load_char(arg, victim)) >= 0) { if (GET_LEVEL(victim) <= GET_LEVEL(ch)) { mudlog(BRF, GET_LEVEL(ch) + 1, TRUE, "(GC) %s has linkloaded %s.\n", GET_NAME(ch), GET_NAME(victim)); Crash_load(victim); victim->next = character_list; character_list = victim; victim->desc = NULL; char_to_room(victim, IN_ROOM(ch)); act("You linkload $N.", FALSE, ch, 0, victim, TO_CHAR); act("$n linkloads $N.", FALSE, ch, 0, victim, TO_NOTVICT); } else { send_to_char(ch, "Sorry, you aren't godly enough to linkload that char.\r\n"); free_char(victim); } } else { send_to_char(ch, "No such player exists.\r\n"); free(victim); } return; }
Last edit: 21 Mar 2017 23:16 by cunning.

Please Log in or Create an account to join the conversation.

Time to create page: 0.221 seconds