Adding ifchecks to act_wiz

Posted by Saryn on Wed 27 Aug 2003 01:20 AM — 6 posts, 23,384 views.

USA #0
Ok i want to add 2 ifchecks to the following code for duedates...


if ( ( !str_cmp( arg2, "days" ) || !str_cmp( arg2, "months" ) ) && ch->owner == FALSE )
    {
    	send_to_char( "Only Josh may set custom duedate durations.\n\r", ch );
    	return;
    }


I want to add an ifcheck for director_newbie and director_asst_newbie (these are put in pfiles along with owner. I tried:



if ( ( !str_cmp( arg2, "days" ) || !str_cmp( arg2, "months" ) ) ch->owner == FALSE && ( ch->director_newbie == FALSE && ch->director_asst_newbie == FALSE ) )

    {
    	send_to_char( "Only Josh may set custom duedate durations.\n\r", ch );
    	return;
    }


And it didn't like that. Any suggestions?
Amended on Wed 27 Aug 2003 02:23 AM by Saryn
USA #1
What errors did it give you? Have you added director_newbie and director_asst_newbie to the CHAR_DATA struct in mud.h?
USA #2
It basically says there is a parse error before the next if after the code I posted
Amended on Thu 28 Aug 2003 12:21 AM by Saryn
USA #3
Looks like your missing an and. Perhaps this will work:


if ( ( !str_cmp( arg2, "days" ) || !str_cmp( arg2, "months" ) ) && ch->owner == FALSE && ( ch->director_newbie == FALSE && ch->director_asst_newbie == FALSE ) )

Amended on Thu 28 Aug 2003 12:33 AM by Nick Cash
USA #4
Haha...can't believe I didnt see that.. Thanks alot..it works.
USA #5
Heh, no problem, I do that all the time. :)