Announcement

Collapse
No announcement yet.

Works one way but not the other?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Works one way but not the other?

    This is a peice from my vehicle:

    simulated event DrivingStatusChanged()
    {
    super.DrivingStatusChanged();
    if (bDriving)
    {
    SetTimer(1.0,true);
    if (bObsCloakedDamaged) <---notice here
    {
    if (Health > DamagedCloakHealth) <--and here
    {
    Cloak(true,false);
    }
    }
    }
    else
    SetTimer(0.1,false);
    Cloak(false,false);
    }

    Notice the middle if's. How can I combine them? When I try:

    if (bObsCloakedDamaged) && (Health > DamagedCloakHealth)

    It gives me errors saying I can't use the && there.

    Anyone know what I am doing wrong?

    #2
    you need to have brackets surround the && equation like so:

    Code:
    if((bObsCloakedDamaged) && (Health > DamagedCloakHealth))

    Comment


      #3
      Ah, thanks so much XD

      Comment

      Working...
      X