Announcement

Collapse
No announcement yet.

Works one way but not the other?

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

  • replied
    Ah, thanks so much XD

    Leave a comment:


  • replied
    you need to have brackets surround the && equation like so:

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

    Leave a comment:


  • started a topic Works one way but not the other?

    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?
Working...
X