Announcement
Collapse
No announcement yet.
Works one way but not the other?
Collapse
X
-
Hsoolien repliedyou need to have brackets surround the && equation like so:
Code:if((bObsCloakedDamaged) && (Health > DamagedCloakHealth))
Leave a comment:
-
legacy-PlayerPawn 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?Tags: None
Leave a comment: