Heya can anyone look at the code I just made, whenever I type selfdestruct it gives me Syntax: blabla but when i type selfdestruct ship now or the other option nothing happens. Here's the code:
void do_selfdestruct(CHAR_DATA *ch, char *argument)
{
SHIP_DATA *ship;
{
if ( (ship = ship_from_cockpit(ch->in_room->vnum)) == NULL )
{
send_to_char("&RYou must be in the cockpit of a ship to do that!\n\r",ch);
return;
}
if ( !check_pilot( ch , ship ) )
{
send_to_char("This isn't your ship!\n\r" , ch );
return;
}
if (ship->shipstate == SHIP_DOCKED)
{
send_to_char("&RYour ship is docked!\n\r",ch);
return;
}
if (ship->shipstate == SHIP_HYPERSPACE)
{
send_to_char("&RYou can only do that in realspace!\n\r",ch);
return;
}
{
if ( str_cmp( argument, "ship now" )
&& str_cmp( argument, "ship now silent" ) )
send_to_char( "Syntax: 'ship now' or 'ship now silent'\n\r", ch );
return;
}
if ( str_cmp( argument, "ship now" ) )
send_to_char("Selfdestruct activated!",ch);
echo_to_ship( AT_YELLOW , ship , "ALERT: Selfdestruct activated...you have one minute to get to minimum safe distance" );
add_timer ( ch , TIMER_DO_FUN , 60 , do_selfdestruct , 1 );
}
if ( str_cmp( argument, "ship now silent" ) )
send_to_char( "&RSilent selfdestruct mode activated...\n\r",ch ) ;
add_timer ( ch , TIMER_DO_FUN , 60 , do_selfdestruct , 1 );
}
destroy_ship(ship , NULL);
}