Trying to add a togglemurder function so players do not kill if they dont want to, for free pk fights or player events. Its been giving me a little problem but here is what I got.
the code.
the errors
player.c: In function `toggle_murder':
player.c:2053: called object is not a function
player.c:2053: parse error before ';' token
player.c:2056: request for member `act' in something not a structure or union
player.c:2056: request for member `hit' in something not a structure or union
player.c:2058: request for member `hit' in something not a structure or union
cc1: warnings being treated as errors
player.c:2060: warning: passing arg 3 of `act' from incompatible pointer type
player.c:2061: warning: passing arg 3 of `act' from incompatible pointer type
the code.
void toggle_murder(CHAR_DATA *ch, char *argument)
{
char *victim;
set_char_color( AT_RED, ch );
ch_printf( ch, "You are set to %s.\n\are.", xIS_SET( ch->act, PLR_MURDER ) ? "stun" : "murder" );
if( !xIS_SET( ch->act, PLR_MURDER )
2053-> xSET_BIT( ch->act, PLR_MURDER );
else
xREMOVE_BIT( ch->act, PLR_MURDER );
if( !IS_NPC( victim ) && xIS_SET( ch->act, PLR_MURDER ) && victim->hit < 1 )
{
victim->hit = 0;
ch_printf( ch, "You spare your victim!" );
act( AT_RED, "$n's life has been spared!", victim, NULL, NULL, TO_ROOM );
act( AT_RED, "Your life has been spared, this time.", victim, NULL, NULL, TO_CHAR );
}
return;
}
the errors
player.c: In function `toggle_murder':
player.c:2053: called object is not a function
player.c:2053: parse error before ';' token
player.c:2056: request for member `act' in something not a structure or union
player.c:2056: request for member `hit' in something not a structure or union
player.c:2058: request for member `hit' in something not a structure or union
cc1: warnings being treated as errors
player.c:2060: warning: passing arg 3 of `act' from incompatible pointer type
player.c:2061: warning: passing arg 3 of `act' from incompatible pointer type