Hi
Ive started to have a few problems with the following GUI.. particularly with the button GUI that opens them up.
Could someone please check below code and see where i may have errored...
At the moment a gui comes up when no clue is found... ie the else statement..
function Button7_OnClick(GUIControl *control, MouseButton button)
{
if (player.HasInventory(ihair)) {
ghair.Visible=true;
gdocs.Visible=false;
}
if (player.HasInventory(idoc)) {
gdocs.Visible=true;
ghair.Visible=false;
}
if(player.HasInventory(ihair)&& player.HasInventory(idoc)){
ghair.Visible=false;
gdocs.Visible=false;
ghairdoc.Visible=true;
}
if(player.HasInventory(iphoto)){
gprofile.Visible=true;
}
if(player.HasInventory(idisguise)){
gdablodis.Visible=true;
}
if(player.HasInventory(icordainates)){
gcords.Visible=true;
}
if(player.HasInventory(idisguise)&& player.HasInventory(icordainates)){
gcorddisguise.Visible=true;
}
if(player.HasInventory(iphoto)){
gcorddisguise.Visible=true;
}
if(player.HasInventory(idis)){
gbossdiss.Visible=true;
}
if(player.HasInventory(iprint)){
gprints.Visible=true;
}
if(player.HasInventory(inote2)){
gprofnote.Visible=true;
}
else { gnotepad.Visible=true;
}
}
Cheers if someone could check for me..
barefoot
Currently your else statement is called whenever this isn't true:
if(player.HasInventory(inote2)){
gprofnote.Visible=true;
}
Everything else isn't taken into account. Instead of
if..
if..
if..
if..
else..
you need to use "else if":
if..
else if..
else if..
else if..
else..
I don't know if that is your problem, but it seems to be.
That sounds logical Matti.. guess im going senile.. :=
just trying to get this bit right at the end:
}
else {
gnotepad1.Visible=true;
}
}
barefoot