Hi: I'm having a problem with my do_feed command. It does not seem to be working.
Now, I should be able to do "feed from <name> <# of blood>", but it does not seem to be doing it.
When I do "Feed from Jermemy 3" it tells me
Quote
feed [target] feed from [target]
My logging shows me this:
Quote
from is arg1. jeremy is arg2. 3 is arg3.
What's going wrong?
void do_feed(CHAR_DATA *ch, char *string) { char arg1[MSL]={'\0'}; char arg2[MSL]={'\0'}; char arg3[MSL]={'\0'}; CHAR_DATA *victim; int i = 0;
CheckCH(ch);
string = one_argument(string, arg1); string = one_argument(string, arg2); string = one_argument(string, arg3); //These are to make sure I'm passing the variables to the right place. log_string( Format("%s is arg1.", arg1)); log_string( Format("%s is arg2.", arg2)); log_string( Format("%s is arg3.", arg3));
if(ch == victim) { send_to_char("Why would you want to feed from yourself?\n\r", ch); return; }
if(IS_SET(victim->act2, ACT2_RP_ING)) { send_to_char("You cannot use ooc feeding on an RP-ing player.\n\r", ch); return; }
if(!IS_NULLSTR(arg3) && !is_number(arg3)) { send_to_char("How much do you want to bleed?", ch); return; } else if(is_number(arg3)) { i = atoi(arg3); if(i > 3) { i = 3; send_to_char("Feeding has been limited to 3 blood points per feed.\n\r", ch); } blood_drink(ch, victim, i, TRUE); WAIT_STATE(ch, 3); } else { blood_drink(ch, victim, 1, TRUE); WAIT_STATE(ch, 3); }
return; }
if(!is_number(arg2) && !IS_NULLSTR(arg2) ) { send_to_char("How much do you want to bleed?", ch); return; }
if( (i = atoi(arg2)) <= 0 ) blood_drink(victim, ch, 1, FALSE); else blood_drink(victim, ch, i, FALSE); WAIT_STATE(ch, 2);
I'm having a problem with my do_feed command. It does not seem to be working.
Now, I should be able to do "feed from <name> <# of blood>", but it does not seem to be doing it.
When I do "Feed from Jermemy 3" it tells me
feed from [target]
My logging shows me this:
jeremy is arg2.
3 is arg3.
What's going wrong?