Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Auto Gunshop
- @inputs CS:wirelink [R1 R2 R3 R4 R5 R6 R7 R8 R9 R10]:entity MoneyPot Up Down OkButton
- @outputs SpawnMoneyPot U1 U2 U3 U4 U5 U6 U7 U8 U9 U10
- @persist Select P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
- @trigger
- interval(21) #runs code
- if(first())
- {
- Select = 1
- CS[2041] = 1 #refresh on startup
- print("To change prices type !price (slot) (price)")
- print("Ex. !price 1 350")
- P1=100
- P2=200
- P3=300
- P4=400
- P5=500
- P6=600
- P7=700
- P8=800
- P9=900
- P10=1000
- }
- S = owner():lastSaid():explode(" ")
- if(S[1,string] == "!price")
- {
- if(S[2,string]:toNumber() == 1){ P1 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 2){ P2 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 3){ P3 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 4){ P4 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 5){ P5 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 6){ P6 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 7){ P7 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 8){ P8 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 9){ P9 = S[3,string]:toNumber() }
- if(S[2,string]:toNumber() == 10){ P10 = S[3,string]:toNumber() }
- }
- if(changed(R1:isShipment())){
- CS[2041] = 1
- }
- if(changed(R2:isShipment())){
- CS[2041] = 1
- }
- if(changed(R3:isShipment())){
- CS[2041] = 1
- }
- if(changed(R4:isShipment())){
- CS[2041] = 1
- }
- if(changed(R5:isShipment())){
- CS[2041] = 1
- }
- if(changed(R6:isShipment())){
- CS[2041] = 1
- }
- if(changed(R7:isShipment())){
- CS[2041] = 1
- }
- if(changed(R8:isShipment())){
- CS[2041] = 1
- }
- if(changed(R9:isShipment())){
- CS[2041] = 1
- }
- if(changed(R10:isShipment())){
- CS[2041] = 1
- }
- CS:writeString(" Welcome To My Auto Gunshop ",0,0,999,37)
- CS:writeString(" Weapons Price ",0,1,999,39)
- CS:writeString("Pick a weapon and put money, ",0,14,999,39)
- CS:writeString("Now click the enter button ",0,15,999,38)
- CS:writeString("And your weapon will come out!",0,16,999,37)
- CS:writeString("Money Inside Pot:" + MoneyPot + "$" + " ",0,17,999,19)
- CS:writeString(R1:shipmentName() + " X" +R1:shipmentAmount():toString(),3,3,999) #select = 3
- CS:writeString(R2:shipmentName() + " X" +R2:shipmentAmount():toString(),3,4,999) #select = 2
- CS:writeString(R3:shipmentName() + " X" +R3:shipmentAmount():toString(),3,5,999) #select = 1
- CS:writeString(R4:shipmentName() + " X" +R4:shipmentAmount():toString(),3,6,999) #select = 1
- CS:writeString(R5:shipmentName() + " X" +R5:shipmentAmount():toString(),3,7,999) #select = 1
- CS:writeString(R6:shipmentName() + " X" +R6:shipmentAmount():toString(),3,8,999) #select = 1
- CS:writeString(R7:shipmentName() + " X" +R7:shipmentAmount():toString(),3,9,999) #select = 1
- CS:writeString(R8:shipmentName() + " X" +R8:shipmentAmount():toString(),3,10,999) #select = 1
- CS:writeString(R9:shipmentName() + " X" +R9:shipmentAmount():toString(),3,11,999) #select = 1
- CS:writeString(R10:shipmentName() + " X" +R10:shipmentAmount():toString(),3,12,999) #select = 1
- #Prices
- CS:writeString(P1 + "$",25,3,999)
- CS:writeString(P2 + "$",25,4,999)
- CS:writeString(P3 + "$",25,5,999)
- CS:writeString(P4 + "$",25,6,999)
- CS:writeString(P5 + "$",25,7,999)
- CS:writeString(P6 + "$",25,8,999)
- CS:writeString(P7 + "$",25,9,999)
- CS:writeString(P8 + "$",25,10,999)
- CS:writeString(P9 + "$",25,11,999)
- CS:writeString(P10 + "$",25,12,999)
- CS:writeString("->",0,6-Select,38) #if select is 3, 6-3= line 3, if 2 then line 6-2=4
- if(Up && changed(Up))
- {
- Select++
- CS[2041] = 1
- }
- if(Down&& changed(Down))
- {
- Select--
- CS[2041] = 1
- }
- if(Select>3)
- {
- Select = -6
- }
- if(Select<-6)
- {
- Select = 3
- }
- if(Select==3 && MoneyPot==P1 && OkButton)
- {
- U1 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U1 = 0
- }
- if(Select==2 && MoneyPot==P2 && OkButton)
- {
- U2 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U2 = 0
- }
- if(Select==1 && MoneyPot==P3 && OkButton)
- {
- U3 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U3 = 0
- }
- if(Select==0 && MoneyPot==P4 && OkButton)
- {
- U4 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U4 = 0
- }
- if(Select==-1 && MoneyPot==P5 && OkButton)
- {
- U5 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U5 = 0
- }
- if(Select==-2 && MoneyPot==P6 && OkButton)
- {
- U6 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U6 = 0
- }
- if(Select==-3 && MoneyPot==P7 && OkButton)
- {
- U7 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U7 = 0
- }
- if(Select==-4 && MoneyPot==P8 && OkButton)
- {
- U8 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U8 = 0
- }
- if(Select==-5 && MoneyPot==P9 && OkButton)
- {
- U9 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U9 = 0
- }
- if(Select==-6 && MoneyPot==P10 && OkButton)
- {
- U10 =1
- SpawnMoneyPot = 1
- }
- else
- {
- U10 = 0
- }
- if(!OkButton)
- {
- SpawnMoneyPot = 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement