Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.41 KB | None | 0 0
  1. @name Autogunshop - Forum
  2. @inputs EGP:wirelink User:entity [R1,R2,R3,R4,R5,R6,R7,R8]:entity
  3. @outputs [U1,U2,U3,U4,U5,U6,U7,U8]:normal I1 I2 I3 I4
  4. @persist [Pris,Cbox1,Cbox2,Cbox3,Cbox4,Cbox5,Cbox6,Cbox7,Cbox8,Profit,Ready,Login,SCount,S]:number LoginPlayer:entity
  5.  
  6. runOnChat(1)
  7. if(chatClk() & !chatClk(owner())){exit()}
  8. Said = owner():lastSaid():lower():explode(" ")
  9. if(Said[1,string]=="!profit"){Profit = Said[2,string]:toNumber()}
  10. if(Said[1,string]=="!sold" & chatClk(owner())){print("Du har solgt "+SCount+" v"+aa()+"ben")}
  11. if(Said[1,string]=="!close"){
  12. EGP:egpClear()
  13. EGP:egpBox(1,vec2(256,256),vec2(512,512))
  14. EGP:egpMaterial(1,"console/background02")
  15. EGP:egpText(4,"AUTOGUNSHOP",vec2(250,10)) EGP:egpAlign(4,1) EGP:egpSize(4,50) EGP:egpFont(4,"Marlett") EGP:egpColor(4,vec(0,0,0))
  16. EGP:egpText(2,"Gunshoppen er lukket",vec2(250,100)) EGP:egpAlign(2,1) EGP:egpSize(2,50) EGP:egpColor(2,vec(0,0,0))
  17. EGP:egpText(3,"Kom tilbage senere",vec2(250,150)) EGP:egpAlign(3,1) EGP:egpSize(3,50) EGP:egpColor(3,vec(0,0,0))
  18. S = 0
  19. }
  20.  
  21. if(Said[1,string]=="!opfyldning"){
  22. EGP:egpClear()
  23. EGP:egpBox(1,vec2(256,256),vec2(512,512))
  24. EGP:egpMaterial(1,"console/background02")
  25. EGP:egpText(4,"AUTOGUNSHOP",vec2(250,10)) EGP:egpAlign(4,1) EGP:egpSize(4,50) EGP:egpFont(4,"Marlett") EGP:egpColor(4,vec(0,0,0))
  26. EGP:egpText(2,"Gunshoppen er lukket",vec2(250,100)) EGP:egpAlign(2,1) EGP:egpSize(2,50) EGP:egpColor(2,vec(0,0,0))
  27. EGP:egpText(3,"Vi fylder v"+aa()+"ben op",vec2(250,150)) EGP:egpAlign(3,1) EGP:egpSize(3,50) EGP:egpColor(3,vec(0,0,0))
  28. S = 0
  29. }
  30.  
  31. if(first()){
  32. function number egpClick(CursorPos:vector2,ObjId){
  33. EPos = EGP:egpPos(ObjId)
  34. ESize = EGP:egpSize(ObjId)
  35. if(inrange(CursorPos, (EPos - ESize/2), (EPos + ESize/2))){
  36. return 1
  37. }
  38. return 0
  39. }
  40.  
  41. function string entity:wepName(){
  42. if(This:isShipment()){
  43. return This:shipmentName()
  44. }else{return "Udsolgt"}}
  45.  
  46. function number entity:wepPrice(){
  47. if(This:isShipment()){
  48. return This:shipmentPrice()+Profit
  49. }else{return 0}
  50. }
  51.  
  52. Font = "Marlett"
  53. timer("startUp",250)
  54. Profit = 200
  55. S = 1
  56. function void loggedin(){
  57. EGP:egpClear()
  58. EGP:egpBox(1,vec2(256,256),vec2(512,512))
  59. EGP:egpMaterial(1,"console/background02")
  60.  
  61. EGP:egpText(2,"AUTOGUNSHOP",vec2(250,10)) EGP:egpAlign(2,1) EGP:egpSize(2,50) EGP:egpFont(2,Font) EGP:egpColor(2,vec4(0,0,0,255))
  62.  
  63. EGP:egpBox(3,vec2(250,65),vec2(400,10)) EGP:egpColor(3,vec4(0,0,0,255))
  64. EGP:egpBox(4,vec2(250,450),vec2(400,100)) EGP:egpColor(4,vec4(0,0,0,200))
  65. EGP:egpText(5,"INGEN V"+aaL()+"BEN VALGT",vec2(250,430)) EGP:egpAlign(5,1) EGP:egpSize(5,40) EGP:egpFont(5,Font)
  66. EGP:egpText(50,"Kopiert af:"+owner():name()+" | Lavet af: CasperDK | Offentliggjort p"+aa()+" forum",vec2(250,0)) EGP:egpSize(50,10) EGP:egpAlign(50,1)
  67.  
  68. for(I=1, 8){EGP:egpBox(5+I,vec2(250,53+(I*40)),vec2(400,35)) EGP:egpColor(5+I,vec4(175,50,50,235))}
  69. }
  70.  
  71.  
  72.  
  73. function void login(){
  74. EGP:egpClear()
  75. EGP:egpBox(1,vec2(256,256),vec2(512,512)) EGP:egpMaterial(1,"console/background02")
  76. EGP:egpBox(3,vec2(250,350),vec2(300,100)) EGP:egpColor(3,vec4(200,50,50,135))
  77. EGP:egpText(2,"AUTOGUNSHOP",vec2(250,10)) EGP:egpAlign(2,1) EGP:egpSize(2,50) EGP:egpFont(2,Font) EGP:egpColor(2,vec4(0,0,0,255))
  78. EGP:egpText(4,"LOGIN",vec2(250,325)) EGP:egpAlign(4,1) EGP:egpSize(4,50) EGP:egpFont(4,Font)
  79. LoginPlayer = noentity()
  80. Ready = 1
  81. I1 = 0 I2 = 0 I3 = 0 I4 = 0
  82. }
  83. }
  84.  
  85. if(Said[1,string]=="!open" & chatClk(owner())){login()}
  86.  
  87. if(~User & User:keyUse() & LoginPlayer == User & ops()< 100 & Login==1 & !S==0){
  88. Cursor = EGP:egpCursor(User)
  89. if(egpClick(Cursor,6)&R1:isShipment()){
  90. if(Cbox1==0){
  91. Pris += R1:wepPrice() Cbox1 = 1
  92. EGP:egpColor(6,vec4(50,175,50,235))
  93. }else{
  94. Pris -= R1:wepPrice() Cbox1 = 0 EGP:egpColor(6,vec4(175,50,50,235))}
  95. exit()
  96. }elseif(egpClick(Cursor,7)&R2:isShipment()){
  97. if(Cbox2==0){
  98. Pris += R2:wepPrice() Cbox2 = 1
  99. EGP:egpColor(7,vec4(50,175,50,235))
  100. }else{
  101. Pris -= R2:wepPrice() Cbox2 = 0
  102. EGP:egpColor(7,vec4(175,50,50,235))
  103. }
  104. exit()
  105. }elseif(egpClick(Cursor,8)&R3:isShipment()){
  106. if(Cbox3==0){
  107. Pris += R3:wepPrice() Cbox3 = 1
  108. EGP:egpColor(8,vec4(50,175,50,235))
  109. }else{
  110. Pris -= R3:wepPrice() Cbox3 = 0
  111. EGP:egpColor(8,vec4(175,50,50,235))
  112. }
  113. exit()
  114. }elseif(egpClick(Cursor,9)&R4:isShipment()){
  115. if(Cbox4==0){
  116. Pris += R4:wepPrice() Cbox4 = 1
  117. EGP:egpColor(9,vec4(50,175,50,235))
  118. }else{
  119. Pris -= R4:wepPrice() Cbox4 = 0
  120. EGP:egpColor(9,vec4(175,50,50,235))
  121. }
  122. exit()
  123. }elseif(egpClick(Cursor,10)&R5:isShipment()){
  124. if(Cbox5==0){
  125. Pris += R5:wepPrice() Cbox5 = 1
  126. EGP:egpColor(10,vec4(50,175,50,235))
  127. }else{
  128. Pris -= R5:wepPrice() Cbox5 = 0
  129. EGP:egpColor(10,vec4(175,50,50,235))
  130. }
  131. exit()
  132. }elseif(egpClick(Cursor,11)&R6:isShipment()){
  133. if(Cbox6==0){
  134. Pris += R6:wepPrice() Cbox6 = 1
  135. EGP:egpColor(11,vec4(50,175,50,235))
  136. }else{
  137. Pris -= R6:wepPrice() Cbox6 = 0
  138. EGP:egpColor(11,vec4(175,50,50,235))
  139. }
  140. exit()
  141. }elseif(egpClick(Cursor,12)&R7:isShipment()){
  142. if(Cbox7==0){
  143. Pris += R7:wepPrice() Cbox7 = 1
  144. EGP:egpColor(12,vec4(50,175,50,235))
  145. }else{
  146. Pris -= R7:wepPrice() Cbox7 = 0
  147. EGP:egpColor(12,vec4(175,50,50,235))
  148. }
  149. exit()
  150. }elseif(egpClick(Cursor,13)&R8:isShipment()){
  151. if(Cbox8==0){
  152. Pris += R8:wepPrice() Cbox8 = 1
  153. EGP:egpColor(13,vec4(50,175,50,235))
  154. }else{
  155. Pris -= R8:wepPrice() Cbox8 = 0
  156. EGP:egpColor(13,vec4(175,50,50,235))
  157. }
  158. exit()
  159. }
  160. if(egpClick(Cursor,4)){
  161. moneyRequest(LoginPlayer,Pris,"K"+oeL()+"B")
  162. }
  163.  
  164. if(egpClick(Cursor,110)&Login==1){timer("reset",50)}
  165. }
  166.  
  167. if(clk("startUp")){login()}
  168. if(clk("reset")){login() stopAllTimers()}
  169.  
  170. if(clk("rest")){
  171. EGP:egpText(15,R1:wepName()+" ~ "+R1:wepPrice()+"kr.",vec2(250,75))
  172. EGP:egpText(16,R2:wepName()+" ~ "+R2:wepPrice()+"kr.",vec2(250,117))
  173. EGP:egpText(17,R3:wepName()+" ~ "+R3:wepPrice()+"kr.",vec2(250,157))
  174. EGP:egpText(18,R4:wepName()+" ~ "+R4:wepPrice()+"kr.",vec2(250,197))
  175. EGP:egpText(19,R5:wepName()+" ~ "+R5:wepPrice()+"kr.",vec2(250,237))
  176. EGP:egpText(20,R6:wepName()+" ~ "+R6:wepPrice()+"kr.",vec2(250,277))
  177. EGP:egpText(21,R7:wepName()+" ~ "+R7:wepPrice()+"kr.",vec2(250,317))
  178. EGP:egpText(22,R8:wepName()+" ~ "+R8:wepPrice()+"kr.",vec2(250,357))
  179. for(I=1,8){EGP:egpAlign(14+I,1) EGP:egpFont(14+I,Font) EGP:egpSize(14+I,30)}
  180.  
  181. EGP:egpBox(110,vec2(22,22),vec2(35,35)) EGP:egpMaterial(110,"gui/close_32") EGP:egpColor(110,vec4(150,50,50,200))
  182. Cbox1 = 0 Cbox2 = 0 Cbox3 = 0 Cbox4 = 0 Cbox5 = 0 Cbox6 = 0 Cbox7 = 0 Cbox8 = 0 Pris = 0 Login = 1
  183. timer("update",5000)
  184. }
  185.  
  186. if(~User & User:keyUse() & ops()<150 & Ready == 1 & !S==0){
  187. Cursor = EGP:egpCursor(User)
  188. if(egpClick(Cursor,3)){
  189. loggedin()
  190. timer("rest",400)
  191. LoginPlayer = User
  192. }
  193. }
  194.  
  195. if (clk("update")){
  196. if (round(((entity():pos() - LoginPlayer:pos()):length()))>150){timer("reset",500)}
  197. timer("update",5000)
  198. }
  199.  
  200. if(moneyClk("K"+oeL()+"B")){
  201. EGP:egpText(51,"TAK",vec2(250,250)) EGP:egpAlign(51,1) EGP:egpFont(51,Font) EGP:egpSize(51,100) EGP:egpColor(51,vec4(200,50,50,255))
  202. if(Cbox1 == 1){U1 = 1 SCount++}
  203. if(Cbox2 == 1){U2 = 1 SCount++}
  204. if(Cbox3 == 1){U3 = 1 SCount++}
  205. if(Cbox4 == 1){U4 = 1 SCount++}
  206. if(Cbox5 == 1){U5 = 1 SCount++}
  207. if(Cbox6 == 1){U6 = 1 SCount++}
  208. if(Cbox7 == 1){U7 = 1 SCount++}
  209. if(Cbox8 == 1){U8 = 1 SCount++}
  210. timer("T",1000)
  211. timer("reset",2000)
  212. timer("Blink",100)
  213.  
  214. }
  215. if(clk("Blink")){I1 = 1 I2 = 1 I3 = 1 I4 = 1 timer("stopBlink",100)}
  216. if(clk("stopBlink")){I1 = 0 I2 = 0 I3 = 0 I4 = 0 timer("Blink",100)}
  217.  
  218. if(clk("T")){U1 = 0 U2 = 0 U3 = 0 U4 = 0 U5 = 0 U6 = 0 U7 = 0 U8 = 0}
  219.  
  220. if(Cbox1 | Cbox2 | Cbox3 | Cbox4 | Cbox5 | Cbox6 | Cbox7 | Cbox8 == 1){EGP:egpSetText(5,"Pris: "+Pris+"kr.")}else{EGP:egpSetText(5,"INGEN V"+aaL()+"BEN VALGT")}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement