Page 1 of 1

Probably an easy answer.

PostPosted: Tue May 28, 2013 9:23 pm
by RippeR7420
How would I go about doing this:

Code: Select all
        if(P2SQUARECOUNT>P1SQUARECOUNT&&P2SQUARECOUNT>P3SQUARECOUNT&&P2SQUARECOUNT>P4SQUARECOUNT)
        {
            CreateActor("Shoot", "Needs More People", "view", "(none)", 160, 240, false);
        }
        else
        if(P2SQUARECOUNT<P1SQUARECOUNT&&P2SQUARECOUNT>P3SQUARECOUNT&&P2SQUARECOUNT>P4SQUARECOUNT)
        {
            CreateActor("Shoot", "Needs More People", "view", "(none)", 160, 240, false);
        }


This will only tell the engine if P2SQUARECOUNT is greater than the rest or lower than the rest. But I want to be able to check if just P3SQUARECOUNT is higher but the rest are lower etc.. without a huge code..?

is there a way to use "&&" better? like maybe, "||" or "&|"?

what exactly does this "||" mean?

Thanks to anyone that can help me!

Re: Probably an easy answer.

PostPosted: Tue May 28, 2013 10:46 pm
by AliceXIII
|| is a conditional or
as in:
Code: Select all
int i;
if(i=0||i=1||i=2) //if i = 0 or 1 or 2
{
    //put code here
}