Page 1 of 1

"if" statment

Posted: Wed Jul 19, 2006 7:48
by jflkbob
the if statment won't work correctally much any more, any ideas.
this should work from what i can rember about how the if works, but doesnt

Code: Select all

#include "zcommon.acs"

int KillHim;

script 1 (void)
{
KillHim=1;//player hits switch, variable is now one
}

script 2 (void)
{
If(KillHim==1);{Thing_Damage(0, 999, 0);}//should only work when KillHim is one, but works all the time
}

Posted: Wed Jul 19, 2006 8:28
by BioHazard
WTF?

Just set the switch to do the damaging!


Oh, to answer your question: remove the semicolon after the if().

Posted: Wed Jul 19, 2006 8:48
by jflkbob
oh yeha, oops :oops: