• Expression 2 & Console Screen Problem?
    3 replies, posted
Hello out there :) Well ye, im just start at using Expression 2, aswell with the Console Screen, but seem to be pretty simple for me, just one thing i been fighting with all night. Okay, I will try to explain.. Im trying to make a Automatic Gunshop, and ppl can buy guys from a Console Screen, you might seen it before :) - Whatever, I want 3 buttons, Up, Down, Enter & Reset. Up and Down is for the select weapon thing I already made. And heres the problem comes, when I wire the thing toghter and i press the down og up button, it goes one down, and when i press again, it going back to top? How can I do so the buttons controle right way? I can't find anything on the internet, i been searching for it all night :/ If anyone know a code or somthing I can use, please tell me :) here the code I use _____________________________________________________________________ @name Creepe's Project @inputs Inc R1 R2 R3 R4 R5 R6 Money CS:wirelink Button @outputs U1 U2 U3 U4 U5 U6 Start @persist S:string H1 H2 H3 H4 H5 H6 Start1 Start2 Start3 Start4 Start 5 Start6 @trigger all interval(21) #This is the codes for highlighted texts if(Inc == 0) {H1 = 900} else{H1 = 0} if(Inc == 1) {H2 = 900} else{H2 = 0} if(Inc == 2) {H3 = 900} else{H3 = 0} if(Inc == 3) {H4 = 900} else{H4 = 0} if(Inc == 4) {H5 = 900} else{H5 = 0} if(Inc == 5) {H6 = 900} else{H6 = 0} #End of highlighted texts codes #This is the start of the codes that display the texts CS:writeString("*******Creepe's Gunshop*******",0,0,49,900,1) CS:writeString("Shotgun $200",0,2,999,H1) CS:writeString("AK47 $300",0,3,999,H2) CS:writeString("M4 $300",0,4,999,H3) CS:writeString("MP5 $300",0,5,999,H4) CS:writeString("Sniper $400",0,6,999,H5) CS:writeString("A2 Sniper $400",0,7,999,H6) #End of texts #This is the in stock and out of stock codes if(R1>0) {CS:writeString(" In Stock ",15,2,999,50)} else{ CS:writeString("Out of Stock",15,2,999,900)} if(R2>0) {CS:writeString(" In Stock ",15,3,999,50)} else{ CS:writeString("Out of Stock",15,3,999,900)} if(R2>0) {CS:writeString(" In Stock ",15,4,999,50)} else{ CS:writeString("Out of Stock",15,4,999,900)} if(R2>0) {CS:writeString(" In Stock ",15,5,999,50)} else{ CS:writeString("Out of Stock",15,5,999,900)} if(R2>0) {CS:writeString(" In Stock ",15,6,999,50)} else{ CS:writeString("Out of Stock",15,6,999,900)} if(R2>0) {CS:writeString(" In Stock ",15,7,999,50)} else{ CS:writeString("Out of Stock",15,7,999,900)} #End of in/out of stock #Start of user functions if((Money==200) & (Inc==0) & (Button==1) & (R1>0)) { Start1 = 1,U1 = 1} else{Start1 = 0,U1 = 0} if((Money==300) & (Inc==1) & (Button==1) & (R1>0)) { Start2 = 1,U2 = 1} else{Start1 = 0,U2 = 0} if((Money==300) & (Inc==2) & (Button==1) & (R1>0)) { Start3 = 1,U3 = 1} else{Start1 = 0,U3 = 0} if((Money==300) & (Inc==3) & (Button==1) & (R1>0)) { Start4 = 1,U4 = 1} else{Start1 = 0,U4 = 0} if((Money==400) & (Inc==4) & (Button==1) & (R1>0)) { Start5 = 1,U5 = 1} else{Start1 = 0,U5 = 0} if((Money==400) & (Inc==5) & (Button==1) & (R1>0)) { Start6 = 1,U6 = 1} else{Start1 = 0,U6 = 0} Start = (Start1+Start2+Start3+Start4+Start5+Start6) #end of user functions _____________________________________________________________________
Just to let you know... if((Money==400) & (Inc==5) & (Button==1) & ([b]R1[/b]>0)) { Start6 = 1,U6 = 1} else{[b]Start1[/b] = 0,U6 = 0} And you can embed if statements. if (Button) { if (Inc...) {} }
Sorry but I dont unnderstand, could you make a little example for me? :) What is it about?: if((Money==400) & (Inc==5) & (Button==1) & (R1>0)) { Start6 = 1,U6 = 1} else{Start1 = 0,U6 = 0}
Perhaps its because you havnt edited the 'R' and 'Start' values for example in: if((Money==400) & (Inc==5) & (Button==1) & (R1>0)) { Start6 = 1,U6 = 1} else{Start1 = 0,U6 = 0} You have Start6 and U6 but your using R1 and Start1, should the 1's be 6's? Not sure if that will fix your problem though..
Sorry, you need to Log In to post a reply to this thread.