Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. @name Auto Gunshop
  2. @inputs CS:wirelink [R1 R2 R3 R4 R5 R6 R7 R8 R9 R10]:entity MoneyPot Up Down OkButton
  3. @outputs SpawnMoneyPot U1 U2 U3 U4 U5 U6 U7 U8 U9 U10
  4. @persist Select P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
  5. @trigger
  6.  
  7.  
  8. interval(21) #runs code
  9. if(first())
  10. {
  11. Select = 1
  12. CS[2041] = 1 #refresh on startup
  13.  
  14.  
  15. print("To change prices type !price (slot) (price)")
  16. print("Ex. !price 1 350")
  17.  
  18.  
  19. P1=100
  20. P2=200
  21. P3=300
  22. P4=400
  23. P5=500
  24. P6=600
  25. P7=700
  26. P8=800
  27. P9=900
  28. P10=1000
  29. }
  30.  
  31. S = owner():lastSaid():explode(" ")
  32.  
  33. if(S[1,string] == "!price")
  34. {
  35. if(S[2,string]:toNumber() == 1){ P1 = S[3,string]:toNumber() }
  36. if(S[2,string]:toNumber() == 2){ P2 = S[3,string]:toNumber() }
  37. if(S[2,string]:toNumber() == 3){ P3 = S[3,string]:toNumber() }
  38. if(S[2,string]:toNumber() == 4){ P4 = S[3,string]:toNumber() }
  39. if(S[2,string]:toNumber() == 5){ P5 = S[3,string]:toNumber() }
  40. if(S[2,string]:toNumber() == 6){ P6 = S[3,string]:toNumber() }
  41. if(S[2,string]:toNumber() == 7){ P7 = S[3,string]:toNumber() }
  42. if(S[2,string]:toNumber() == 8){ P8 = S[3,string]:toNumber() }
  43. if(S[2,string]:toNumber() == 9){ P9 = S[3,string]:toNumber() }
  44. if(S[2,string]:toNumber() == 10){ P10 = S[3,string]:toNumber() }
  45.  
  46. }
  47.  
  48. if(changed(R1:isShipment())){
  49. CS[2041] = 1
  50. }
  51.  
  52. if(changed(R2:isShipment())){
  53. CS[2041] = 1
  54. }
  55.  
  56. if(changed(R3:isShipment())){
  57. CS[2041] = 1
  58. }
  59.  
  60. if(changed(R4:isShipment())){
  61. CS[2041] = 1
  62. }
  63.  
  64. if(changed(R5:isShipment())){
  65. CS[2041] = 1
  66. }
  67.  
  68. if(changed(R6:isShipment())){
  69. CS[2041] = 1
  70. }
  71.  
  72. if(changed(R7:isShipment())){
  73. CS[2041] = 1
  74. }
  75.  
  76. if(changed(R8:isShipment())){
  77. CS[2041] = 1
  78. }
  79.  
  80. if(changed(R9:isShipment())){
  81. CS[2041] = 1
  82. }
  83.  
  84. if(changed(R10:isShipment())){
  85. CS[2041] = 1
  86. }
  87.  
  88.  
  89.  
  90. CS:writeString(" Welcome To My Auto Gunshop ",0,0,999,37)
  91. CS:writeString(" Weapons Price ",0,1,999,39)
  92.  
  93.  
  94. CS:writeString("Pick a weapon and put money, ",0,14,999,39)
  95. CS:writeString("Now click the enter button ",0,15,999,38)
  96. CS:writeString("And your weapon will come out!",0,16,999,37)
  97. CS:writeString("Money Inside Pot:" + MoneyPot + "$" + " ",0,17,999,19)
  98.  
  99. CS:writeString(R1:shipmentName() + " X" +R1:shipmentAmount():toString(),3,3,999) #select = 3
  100. CS:writeString(R2:shipmentName() + " X" +R2:shipmentAmount():toString(),3,4,999) #select = 2
  101. CS:writeString(R3:shipmentName() + " X" +R3:shipmentAmount():toString(),3,5,999) #select = 1
  102. CS:writeString(R4:shipmentName() + " X" +R4:shipmentAmount():toString(),3,6,999) #select = 1
  103. CS:writeString(R5:shipmentName() + " X" +R5:shipmentAmount():toString(),3,7,999) #select = 1
  104. CS:writeString(R6:shipmentName() + " X" +R6:shipmentAmount():toString(),3,8,999) #select = 1
  105. CS:writeString(R7:shipmentName() + " X" +R7:shipmentAmount():toString(),3,9,999) #select = 1
  106. CS:writeString(R8:shipmentName() + " X" +R8:shipmentAmount():toString(),3,10,999) #select = 1
  107. CS:writeString(R9:shipmentName() + " X" +R9:shipmentAmount():toString(),3,11,999) #select = 1
  108. CS:writeString(R10:shipmentName() + " X" +R10:shipmentAmount():toString(),3,12,999) #select = 1
  109.  
  110. #Prices
  111. CS:writeString(P1 + "$",25,3,999)
  112. CS:writeString(P2 + "$",25,4,999)
  113. CS:writeString(P3 + "$",25,5,999)
  114. CS:writeString(P4 + "$",25,6,999)
  115. CS:writeString(P5 + "$",25,7,999)
  116. CS:writeString(P6 + "$",25,8,999)
  117. CS:writeString(P7 + "$",25,9,999)
  118. CS:writeString(P8 + "$",25,10,999)
  119. CS:writeString(P9 + "$",25,11,999)
  120. CS:writeString(P10 + "$",25,12,999)
  121.  
  122. CS:writeString("->",0,6-Select,38) #if select is 3, 6-3= line 3, if 2 then line 6-2=4
  123.  
  124.  
  125. if(Up && changed(Up))
  126. {
  127.  
  128. Select++
  129. CS[2041] = 1
  130. }
  131.  
  132. if(Down&& changed(Down))
  133. {
  134. Select--
  135. CS[2041] = 1
  136. }
  137.  
  138. if(Select>3)
  139. {
  140. Select = -6
  141. }
  142. if(Select<-6)
  143. {
  144. Select = 3
  145. }
  146.  
  147.  
  148. if(Select==3 && MoneyPot==P1 && OkButton)
  149. {
  150. U1 =1
  151. SpawnMoneyPot = 1
  152. }
  153. else
  154. {
  155. U1 = 0
  156. }
  157.  
  158.  
  159. if(Select==2 && MoneyPot==P2 && OkButton)
  160. {
  161. U2 =1
  162. SpawnMoneyPot = 1
  163. }
  164. else
  165. {
  166. U2 = 0
  167. }
  168.  
  169. if(Select==1 && MoneyPot==P3 && OkButton)
  170. {
  171. U3 =1
  172. SpawnMoneyPot = 1
  173. }
  174. else
  175. {
  176. U3 = 0
  177. }
  178.  
  179. if(Select==0 && MoneyPot==P4 && OkButton)
  180. {
  181. U4 =1
  182. SpawnMoneyPot = 1
  183. }
  184. else
  185. {
  186. U4 = 0
  187. }
  188.  
  189. if(Select==-1 && MoneyPot==P5 && OkButton)
  190. {
  191. U5 =1
  192. SpawnMoneyPot = 1
  193. }
  194. else
  195. {
  196. U5 = 0
  197. }
  198.  
  199. if(Select==-2 && MoneyPot==P6 && OkButton)
  200. {
  201. U6 =1
  202. SpawnMoneyPot = 1
  203. }
  204. else
  205. {
  206. U6 = 0
  207. }
  208.  
  209. if(Select==-3 && MoneyPot==P7 && OkButton)
  210. {
  211. U7 =1
  212. SpawnMoneyPot = 1
  213. }
  214. else
  215. {
  216. U7 = 0
  217. }
  218.  
  219. if(Select==-4 && MoneyPot==P8 && OkButton)
  220. {
  221. U8 =1
  222. SpawnMoneyPot = 1
  223. }
  224. else
  225. {
  226. U8 = 0
  227. }
  228.  
  229. if(Select==-5 && MoneyPot==P9 && OkButton)
  230. {
  231. U9 =1
  232. SpawnMoneyPot = 1
  233. }
  234. else
  235. {
  236. U9 = 0
  237. }
  238.  
  239. if(Select==-6 && MoneyPot==P10 && OkButton)
  240. {
  241. U10 =1
  242. SpawnMoneyPot = 1
  243. }
  244. else
  245. {
  246. U10 = 0
  247. }
  248.  
  249.  
  250. if(!OkButton)
  251. {
  252. SpawnMoneyPot = 0
  253. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement