Jump to content
ℹ️ Intermittent Download History issues ×

Need help for multibutton switch


Recommended Posts

@ dylbill.

Yeah.... neither yours nor mine needs a timer (both actually apply the same logic). I've this horrible headache and i'm not thinking straight today.

Also... 3 buttons = 6 possibilities ????

Instead of multiplying I added... I better take one more pill for my headache and stay in bed until it acts...

Link to comment
Share on other sites

Your not the only one to get issue with editing post.

I am french and every post a send is "corrected" by my computer.

I let you imagine when it comes to code...

 

I'll check this out this week if i get some time.

 

Oh and by the way, with 3 binary button we get 8 possibilities(3x3-1) 😉

 

 

Really big thank you for helping me in that way.

Link to comment
Share on other sites

Now that I feel slightly better from my migraine (after swallowing a whole bottle of pills), I'm posting a cleaner version of mine, because it was full of typos and removed the timer, which wasn't needed to begin with.
* Just for the sake of clarity.
Scriptname MyMasterControllerScript extends ObjectReference
 
ObjectReference Property Banner0 Auto
ObjectReference Property Banner1 Auto
ObjectReference Property Banner2 Auto
ObjectReference Property Banner3 Auto
ObjectReference Property Banner4 Auto
ObjectReference Property Banner5 Auto
ObjectReference Property Banner6 Auto
ObjectReference Property Banner7 Auto
 
Bool Property ButtonA = False Auto Hidden
Bool Property ButtonB = False Auto Hidden
Bool Property ButtonC = False Auto Hidden
 
Function CountButton01()
   If ( ButtonA == False )
        ButtonA = True
 Else
        ButtonA = False
EndIf
        FindMatch()
EndFunction
 
Function CountButton02()
   If ( ButtonB == False )
        ButtonB = True
 Else
        ButtonB = False
EndIf
        FindMatch()
EndFunction
 
Function CountButton03()
   If ( ButtonC == False )
        ButtonC = True
 Else
        ButtonC = False
EndIf
        FindMatch()
EndFunction
 
Function FindMatch()
            DisableAllBanners()
     If ( ButtonA == False ) && ( ButtonB == False ) && ( ButtonC == False )
             Banner0.Enable() 
 ElseIf ( ButtonA == True ) && ( ButtonB == False ) && ( ButtonC == False )
             Banner1.Enable() 
 ElseIf ( ButtonA == False ) && ( ButtonB == True ) && ( ButtonC == False )
             Banner2.Enable() 
 ElseIf ( ButtonA == False ) && ( ButtonB == False ) && ( ButtonC == True )
             Banner3.Enable() 
 ElseIf ( ButtonA == True ) && ( ButtonB == True ) && ( ButtonC == False )
             Banner4.Enable() 
 ElseIf ( ButtonA == True ) && ( ButtonB == False ) && ( ButtonC == True )
             Banner5.Enable() 
 ElseIf ( ButtonA == False ) && ( ButtonB == True ) && ( ButtonC == True )
             Banner6.Enable() 
 ElseIf ( ButtonA == True ) && ( ButtonB == True ) && ( ButtonC == True )
             Banner7.Enable() 
 EndIf
EndFunction
 
Function DisableAllBanners()
    Banner0.Disable()
    Banner1.Disable()
    Banner2.Disable()
    Banner3.Disable()
    Banner4.Disable()
    Banner5.Disable()
    Banner6.Disable()
EndFunction

 

EDIT: Why does this s*** happens every time? I write this code:

Function CountButton01()
If ( ButtonA == False )
ButtonA = True
Else
ButtonA = False
EndIf
FindMatch()
EndFunction

 

And I get this post:

Function CountButton01()
If ( ButtonA == False )
ButtonA = True
Else
ButtonA = False
EndIf
FindMatch()
EndFunction

Edited by maxarturo
Link to comment
Share on other sites

I don't know if you are talking about mine or dylbill's, but my first one had a few 'typos' and an unnecessary timer function.

If you are using the script I posted, then you should use the last script I posted, the one that is a little bit above in this page and not the first one.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...