@name _north-tec_ Pricelist V3 @inputs [EGP,EGP2]:wirelink Tastatur:number @outputs @persist [Weapons,Prices,Prices1]:array Shopname:string @persist [Installation,Chosen,Price,Price1]:number @trigger Tastatur if(first()) { EGP:egpClear() EGP2:egpClear() Installation = 1 } # ============== Installation ================= if(Installation == 1) { if(Tastatur == 13){ EGP:egpClear() EGP2:egpClear() EGP:egpText(1,"[North-Tec] Pricelist V3",vec2(10,200)) EGP:egpText(2,"Initializing Installation ....",vec2(10,250)) EGP:egpSize(1,30) EGP:egpSize(2,30) Installation = 3 timer("Installation",2000) } else { EGP:egpText(1,"[North-Tec] Pricelist V3",vec2(10,200)) EGP:egpText(2,"Hit Enter to start the installation",vec2(10,250)) } } if(clk("Installation")) { stoptimer("Installation") EGP:egpText(1,"[North-Tec] Pricelist V3 Installation",vec2(10,100)) EGP:egpText(2,"Enter the Name of your Shop:",vec2(10,150)) EGP:egpText(3,"Only enter lower and uppercase letters.",vec2(10,190)) EGP:egpSize(3,10) Installation = 2 } if(Installation == 2) { if(Tastatur == 13){Installation = 0} if(Tastatur != 154 && Tastatur != 127) { Shopname = Shopname + toUnicodeChar(Tastatur) } if(Tastatur == 127){Shopname = Shopname:left(Shopname:length()-1)} EGP:egpText(4,Shopname,vec2(10,200)) } # ============== Screen ================= if(Installation == 0) { if(~Installation){EGP:egpClear()} # ============== Eingabe ================= if(Price == 1) { if((Tastatur < 17 || Tastatur > 20)) { if(Tastatur == 127){Prices:setString(Chosen,Prices:string(Chosen):left((Prices:string(Chosen):length()-1)))}else{if(toUnicodeChar(Tastatur) == "0" || toUnicodeChar(Tastatur):toNumber()){Prices:setString(Chosen,Prices:string(Chosen)+toUnicodeChar(Tastatur))}} } } elseif(Price1 == 1) { if((Tastatur < 17 || Tastatur > 20)) { if(Tastatur == 127){Prices1:setString(Chosen,Prices1:string(Chosen):left((Prices1:string(Chosen):length()-1)))}else{if(toUnicodeChar(Tastatur) == "0" || toUnicodeChar(Tastatur):toNumber()){Prices1:setString(Chosen,Prices1:string(Chosen)+toUnicodeChar(Tastatur))}} } } else { if((Tastatur < 17 || Tastatur > 20) && Tastatur != 154) { if(Tastatur == 127){Weapons:setString(Chosen,Weapons:string(Chosen):left((Weapons:string(Chosen):length()-1)))}else{Weapons:setString(Chosen,Weapons:string(Chosen)+toUnicodeChar(Tastatur))} } } EGP:egpText(1,Shopname+" (Admin)",vec2(10,10)) EGP:egpColor(1,vec(200,0,0)) EGP:egpBox(2,vec2(256,50),vec2(512,10)) EGP:egpBox(49,vec2(298,280),vec2(2,450)) EGP:egpBox(51,vec2(418,280),vec2(2,450)) EGP:egpText(52,"Shipment",vec2(330,44)) EGP:egpColor(52,vec(0,0,0)) EGP:egpSize(52,12) EGP:egpText(53,"Einzelpreis",vec2(440,44)) EGP:egpColor(53,vec(0,0,0)) EGP:egpSize(53,12) EGP2:egpText(1,Shopname,vec2(10,10)) EGP2:egpColor(1,vec(200,0,0)) EGP2:egpSize(1,30) EGP2:egpBox(2,vec2(256,50),vec2(512,10)) EGP2:egpBox(49,vec2(298,280),vec2(2,450)) EGP2:egpBox(51,vec2(418,280),vec2(2,450)) #EGP2:egpBox(50,vec2(256,220),vec2(512,580)) EGP2:egpBox(50,vec2(256,256),vec2(512,512)) EGP2:egpColor(50,vec(0,0,0)) EGP2:egpOrder(50,-2) EGP2:egpText(52,"Shipment",vec2(330,44)) EGP2:egpColor(52,vec(0,0,0)) EGP2:egpSize(52,12) EGP2:egpText(53,"Einzelpreis",vec2(440,44)) EGP2:egpColor(53,vec(0,0,0)) EGP2:egpSize(53,12) # ======= Deaktiviert, weil kein vernuenftiges Material vorhanden. ======= EGP:egpBox(54,vec2(450,15),vec2(50,50)) EGP:egpMaterial(54,"console/characters/fwk_sniper") EGP2:egpBox(55,vec2(450,15),vec2(50,50)) EGP2:egpMaterial(55,"console/characters/fwk_sniper") for(I=1,15) { EGP:egpText(I+3,Weapons:string(I-1),vec2(10,30+(I*30))) EGP:egpText(I+18,"$"+Prices:string(I-1),vec2(300,30+(I*30))) EGP:egpText(I+33,"$"+Prices1:string(I-1),vec2(420,30+(I*30))) EGP:egpBox(I+56,vec2(256,25+(I*30)),vec2(512,2)) EGP:egpColor(I+3,vec(255,200,0)) EGP2:egpText(I+3,Weapons:string(I-1),vec2(10,30+(I*30))) EGP2:egpText(I+18,"$"+Prices:string(I-1),vec2(300,30+(I*30))) EGP2:egpText(I+33,"$"+Prices1:string(I-1),vec2(420,30+(I*30))) EGP2:egpBox(I+56,vec2(256,25+(I*30)),vec2(512,2)) EGP2:egpColor(I+3,vec(255,200,0)) } # ============== Pfeil ================= EGP:egpSize(3,20) if(Price == 0 && Price1 == 0) { EGP:egpText(3,"<",vec2(280,30+((Chosen+1)*30))) } elseif(Price == 1 && Price1 == 0) { EGP:egpText(3,"<",vec2(400,30+((Chosen+1)*30))) } else { EGP:egpText(3,"<",vec2(500,30+((Chosen+1)*30))) } # ============== Navigation ================= if(Tastatur == 18) # Taste nach unten { if(Chosen < 14) { Chosen++ } } if(Tastatur == 17) # Taste nach oben { if(Chosen > 0) { Chosen-- } } if(Tastatur == 20) # Taste nach Rechts { if(Price == 0 && Price1 == 0) { Price = 1 Price1 = 0 } else { Price1 = 1 Price = 0 } } if(Tastatur == 19) # Taste nach Links { if(Price1 == 1) { Price1 = 0 Price = 1 } elseif(Price == 1) { Price1 = 0 Price = 0 } } }