Advertisement
Guest User

Untitled

a guest
Oct 27th, 2017
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.39 KB | None | 0 0
  1. @name EMBRACE xop
  2. @inputs [EGP, Emitter]:wirelink User:entity [R1 R2 R3 R4 R5 R6]:entity
  3. @outputs U1 U2 U3 U4 U5 U6
  4. @persist S:normal CurUser:entity Profit BPris:normal Admusr
  5. @persist [NameLel PassLel Hejsa Hejsa2 IndL]:string [FinalName FinalPass FinalHejsa FinalHejsa2 FinalIndL Checks]:array CW:table
  6. @trigger User
  7. if(chatClk()&!chatClk(owner())){exit()}
  8. if(duped() | dupefinished()){reset()}
  9. if(first()){
  10. runOnChat(1)
  11. setName("- EMBRACE -
  12. - Version: 2.1 -")
  13.  
  14. ##INDSTILNINGER
  15. Profit = 600
  16. ###############
  17.  
  18. function number roundmoyly(Nm1,Nm2){
  19. return ceil(Nm1/Nm2)*Nm2
  20. }
  21. function void addCursor(){
  22. EGP:egpPoly(999,array(vec2(0,0),vec2(0,15),vec2(3,12),vec2(5,15),vec2(7,15),vec2(6,11),vec2(10,10)))
  23. EGP:egpColor(999,0,0,0,200)
  24. EGP:egpParentToCursor(999)
  25. }
  26. function number wirelink:egpButton(Idx:number,Ply:entity){
  27. TL = This:egpPos(Idx) - This:egpSize(Idx) / 2 * (0 ? 0 : 1)
  28. BR = This:egpPos(Idx) + This:egpSize(Idx) / (0 ? 1 : 2)
  29. Cur = This:egpCursor(Ply) return inrange(Cur, TL, BR) exit()
  30. }
  31. function void resetChecks(){
  32. I=1
  33. while(I<=6){
  34. Checks[I,number]=0
  35. I++
  36. }
  37. }
  38. function string entity:getWepName(){
  39. if(This:isShipment()){
  40. Name=This:shipmentName()
  41. return Name:trim()
  42. }
  43. else{return "Udsolgt"}
  44. }
  45. function number entity:getWepPrice(){
  46. if(This:isShipment()){
  47. Name=This:shipmentName()
  48. Price=This:shipmentPrice()
  49. return roundmoyly(Price,200)+Profit
  50. }
  51. else{return 0}
  52. }
  53. function string getWepdrawName(Nm){
  54. return CW[Nm,array][1,string]+" - "+CW[Nm,array][2,number]+",-"
  55. }
  56.  
  57. function void wirelink:drawEmitter()
  58. {
  59. This:egpClear()
  60.  
  61. This:egpText(1, "E M B R A C E - G U N S H O P", vec2(256,295))
  62. This:egpSize(1, 50)
  63. This:egpAlign(1, 1,1)
  64. This:egpFont(1, "Courier New")
  65. }
  66. Emitter:drawEmitter()
  67.  
  68. function void wirelink:drawLogin(){
  69. S = 1
  70. Admusr=0
  71. This:egpClear()
  72. This:egpBox(1, vec2(256,256), vec2(512,512))
  73. This:egpMaterial(1, "console/background06")
  74. This:egpBox(2, vec2(256,256), vec2(512,512))
  75. This:egpColor(2, vec4(51,52,59, 180))
  76.  
  77. ##EMBRACE LOGO
  78. #HvidBoks
  79. This:egpBox(3, vec2(256,120), vec2(80,80))
  80. This:egpAngle(3, 45)
  81. #Outline
  82. This:egpBoxOutline(4, vec2(256,120), vec2(64,64))
  83. This:egpColor(4, vec(33,33,33))
  84. This:egpAngle(4, 45)
  85. This:egpSize(4, 3)
  86. #MIDTERSTYKKE
  87. This:egpBox(5, vec2(256,120), vec2(3,36))
  88. This:egpColor(5, vec(33,33,33))
  89. #Nederst
  90. This:egpBox(6, vec2(256,130), vec2(21,3))
  91. This:egpColor(6, vec(33,33,33))
  92. #Midterst
  93. This:egpBox(7, vec2(256,120), vec2(21,3))
  94. This:egpColor(7, vec(33,33,33))
  95. #Overst
  96. This:egpBox(8, vec2(256,110), vec2(21,3))
  97. This:egpColor(8, vec(33,33,33))
  98. ##TEKST
  99. This:egpText(9, "E M B R A C E", vec2(256,195))
  100. This:egpAlign(9, 1,1)
  101. This:egpSize(9, 25)
  102. This:egpFont(9, "Verdana")
  103.  
  104. #Email
  105. This:egpBox(10, vec2(256,290), vec2(250,45))
  106. This:egpColor(10, vec4(100,100,100, 100))
  107. This:egpBox(11, vec2(176,290), vec2(1,37))
  108. This:egpColor(11, vec4(150,150,150, 100))
  109. This:egpText(12, "@", vec2(154,288))
  110. This:egpAlign(12, 1,1)
  111. This:egpSize(12, 35)
  112. This:egpFont(12, "Roboto")
  113. This:egpColor(12, vec4(150,150,150, 100))
  114.  
  115. #Kode
  116. This:egpBox(13, vec2(256,350), vec2(250,45))
  117. This:egpColor(13, vec4(100,100,100, 100))
  118. This:egpBox(14, vec2(176,350), vec2(1,37))
  119. This:egpColor(14, vec4(150,150,150, 100))
  120. This:egpText(15, "#", vec2(154,348))
  121. This:egpAlign(15, 1,1)
  122. This:egpSize(15, 35)
  123. This:egpFont(15, "Verdana")
  124. This:egpColor(15, vec4(150,150,150, 100))
  125.  
  126. ##LoginKnap
  127. This:egpBox(16, vec2(256,420), vec2(250,45))
  128. This:egpText(17, "LOG IND", vec2(256,420))
  129. This:egpAlign(17, 1,1)
  130. This:egpSize(17, 25)
  131. This:egpFont(17, "Roboto")
  132. This:egpColor(17, vec(33,33,33))
  133. NameLel=""
  134. This:egpText(18, NameLel, vec2(190,290))
  135. This:egpAlign(18, 0,1)
  136. This:egpSize(18, 22)
  137. This:egpColor(18, vec4(150,150,150, 100))
  138. This:egpFont(18, "Verdana")
  139. PassLel=""
  140. This:egpText(19, PassLel, vec2(190,350))
  141. This:egpAlign(19, 0,1)
  142. This:egpSize(19, 22)
  143. This:egpColor(19, vec4(150,150,150, 100))
  144. This:egpFont(19, "Verdana")
  145.  
  146. This:egpBox(20, vec2(152,349), vec2(42,42))
  147. This:egpColor(20, vec4(255,255,255, 0))
  148. addCursor()
  149. }
  150. function number entity:athdown(){
  151. if(This:pos():distance(EGP:entity():pos())<400){
  152. Ahlst=array()
  153. Ahlst:pushString("STEAM_0:0:56939043")
  154. Ahlst:pushString("STEAM_0:0:37262415")
  155. Ahlst:pushString("STEAM_0:0:18275106")
  156. Ahlst:pushString("STEAM_0:0:5215442")
  157. Ahlst:pushString("STEAM_0:1:149810095")
  158. Ahlst:pushString(owner():steamID())
  159. I=1
  160. C=Ahlst:count()
  161. Authd=0
  162. while(I<=C){
  163. if(Ahlst[I,string]==This:steamID()){
  164. Authd=1
  165. }
  166. I++
  167. }
  168. if(I>C){
  169. return Authd
  170. }
  171. }
  172. }
  173. function void wirelink:drawHejsa(){
  174. S = 2
  175. This:egpClear()
  176. This:egpBox(1, vec2(256,256), vec2(512,512))
  177. This:egpMaterial(1, "console/background06")
  178. This:egpBox(2, vec2(256,256), vec2(512,512))
  179. This:egpColor(2, vec4(51,52,59, 180))
  180.  
  181. This:egpText(3, Hejsa, vec2(256,240))
  182. This:egpAlign(3, 1,1)
  183. This:egpSize(3, 35)
  184. This:egpColor(3, vec4(255,255,255,255))
  185. This:egpFont(3, "Courier New")
  186.  
  187. This:egpText(4, Hejsa2, vec2(256,270))
  188. This:egpAlign(4, 1,1)
  189. This:egpSize(4, 35)
  190. This:egpColor(4, vec4(255,255,255,255))
  191. This:egpFont(4, "Courier New")
  192. CW[1,array]=array(R1:getWepName(),R1:getWepPrice(),R1:shipmentAmount(),1)
  193. CW[2,array]=array(R2:getWepName(),R2:getWepPrice(),R2:shipmentAmount(),2)
  194. CW[3,array]=array(R3:getWepName(),R3:getWepPrice(),R3:shipmentAmount(),3)
  195. CW[4,array]=array(R4:getWepName(),R4:getWepPrice(),R4:shipmentAmount(),4)
  196. CW[5,array]=array(R5:getWepName(),R5:getWepPrice(),R5:shipmentAmount(),5)
  197. CW[6,array]=array(R6:getWepName(),R6:getWepPrice(),R6:shipmentAmount(),6)
  198. timer("Hejsa", 200)
  199. }
  200.  
  201. function void wirelink:drawBase()
  202. {
  203. This:egpClear()
  204. This:egpBox(1, vec2(256,256), vec2(512,512))
  205. This:egpMaterial(1, "console/background06")
  206. This:egpBox(2, vec2(256,256), vec2(512,512))
  207. This:egpColor(2, vec4(51,52,59, 180))
  208.  
  209. ##EMBRACELOGO
  210. This:egpText(3, "E M B R A C E", vec2(256,30))
  211. This:egpAlign(3, 1,1)
  212. This:egpSize(3, 25)
  213. This:egpFont(3, "Verdana")
  214. BPris=0
  215. ##BETALEREN
  216. This:egpBox(99, vec2(256,485), vec2(356,50))
  217. This:egpColor(99, vec(230,230,230))
  218. This:egpText(100, ""+BPris, vec2(256,485))
  219. This:egpAlign(100, 1,1)
  220. This:egpSize(100, 35)
  221. This:egpFont(100, "Courier New")
  222. This:egpColor(100, vec(33,33,33))
  223.  
  224. #KR
  225. This:egpBox(101, vec2(409,485), vec2(50,50))
  226. This:egpColor(101, vec(100,100,100))
  227. This:egpText(102, "KR", vec2(410,485))
  228. This:egpAlign(102, 1,1)
  229. This:egpSize(102, 30)
  230. This:egpFont(102, "Courier New")
  231.  
  232. ##UNDERBOKS
  233. This:egpBox(103, vec2(256,511), vec2(356,2))
  234. This:egpColor(103, vec(157,118,79))
  235.  
  236. ##----PRIS----##
  237. This:egpText(104, "- - - - - - - - - - - PRIS - - - - - - - - - - -", vec2(256,453))
  238. This:egpAlign(104, 1,1)
  239. This:egpSize(104, 14)
  240. This:egpFont(104, "Courier New")
  241.  
  242. ##Tilbage
  243. This:egpBox(105, vec2(256,30), vec2(136,25))
  244. This:egpColor(105, vec4(255,255,255, 1))
  245.  
  246.  
  247.  
  248.  
  249. timer("Afstand", 2000)
  250. }
  251. function void wirelink:drawGuns(){
  252. I=1
  253. while(I<=6){
  254. Pos=I*60
  255. This:egpText(24+I, getWepdrawName(I), vec2(100,20+Pos))
  256. This:egpAlign(24+I, 0,1)
  257. This:egpFont(24+I, "Courier New",25)
  258. I++
  259. }
  260. }
  261. function void wirelink:drawWeaponList(){
  262. I=1
  263. while(I<=6){
  264. Pos=I*60
  265. This:egpBox(13+I, vec2(230,20+Pos), vec2(304,50))
  266. This:egpColor(13+I, vec4(100,100,100, 150))
  267. This:egpText(24+I, getWepdrawName(I), vec2(100,20+Pos))
  268. This:egpAlign(24+I, 0,1)
  269. This:egpFont(24+I, "Courier New",25)
  270. This:egpBoxOutline(35+I, vec2(410,20+Pos), vec2(50,50))
  271. This:egpSize(35+I, 2)
  272. This:egpLine(46+I, vec2(427,83-80+Pos), vec2(393,117-80+Pos))
  273. This:egpSize(46+I, 2)
  274. This:egpAlpha(46+I, 0)
  275. This:egpLine(57+I, vec2(393,83-80+Pos), vec2(427,117-80+Pos))
  276. This:egpSize(57+I, 2)
  277. This:egpAlpha(57+I, 0)
  278. This:egpBox(68+I, vec2(256,20+Pos), vec2(512,50))
  279. This:egpAlpha(68+I,0)
  280. I++
  281. }
  282. }
  283. function void calculateprice(){
  284. I=1
  285. C=CW:count()
  286. CalcVal=0
  287. while(I<=C){
  288. if(Checks[I,number]==1){CalcVal+=CW[I,array][2,number]}
  289. I++
  290. }
  291. if(I>C){
  292. BPris=CalcVal
  293. if(S==3){EGP:egpSetText(100,BPris+"")}
  294. }
  295. }
  296. function void toggleCheck(Nm){
  297. if(Checks[Nm,number]==1){
  298. Checks[Nm,number]=0
  299. EGP:egpAlpha(57+Nm, 0)
  300. EGP:egpAlpha(46+Nm, 0)
  301. calculateprice()
  302. }
  303. else{
  304. Checks[Nm,number]=1
  305. EGP:egpAlpha(57+Nm, 255)
  306. EGP:egpAlpha(46+Nm, 255)
  307. calculateprice()
  308. }
  309. }
  310. EGP:drawLogin()
  311. }
  312. if(~User & User){
  313. if(ops()<100) {
  314. if(CurUser==User & S==3){
  315. if(EGP:egpButton(99, User)&BPris>0){ #Payment
  316. if(Admusr){timer("spawnthewepsy",0)} else{
  317. moneyRequest(CurUser,BPris,"MobilePay")}
  318. }
  319.  
  320. if(EGP:egpButton(69,User)){toggleCheck(1)}
  321. if(EGP:egpButton(70,User)){toggleCheck(2)}
  322. if(EGP:egpButton(71,User)){toggleCheck(3)}
  323. if(EGP:egpButton(72,User)){toggleCheck(4)}
  324. if(EGP:egpButton(73,User)){toggleCheck(5)}
  325. if(EGP:egpButton(74,User)){toggleCheck(6)}
  326.  
  327. if(EGP:egpButton(105,User)){timer("drawfirst",400)}
  328. }
  329. }
  330. }
  331. if(moneyClk("MobilePay") | clk("spawnthewepsy")){
  332. if(Checks[1,number]==1){
  333. U1 = 1
  334. }
  335. if(Checks[2,number]==1){
  336. U2 = 1
  337. }
  338. if(Checks[3,number]==1){
  339. U3 = 1
  340. }
  341. if(Checks[4,number]==1){
  342. U4 = 1
  343. }
  344. if(Checks[5,number]==1){
  345. U5 = 1
  346. }
  347. if(Checks[6,number]==1){
  348. U6 = 1
  349. }
  350. timer("resetBuy", 100)
  351. timer("drawfirst",400)
  352. }
  353. if(clk("resetBuy")){
  354. U1 = 0
  355. U2 = 0
  356. U3 = 0
  357. U4 = 0
  358. U5 = 0
  359. U6 = 0
  360. resetChecks()
  361. BPris = 0
  362. }
  363.  
  364. #####CHATCOMMANDS######################
  365. if(chatClk(owner())){
  366. Said=lastSaid():lower():explode(" ")
  367. Cmd=Said[1,string]
  368. if(Cmd=="!profit"){
  369. if(lastSpoke()==owner()){
  370. Profit=Said[2,string]:toNumber()
  371. print("Satte profit til "+Said[2,string]:toNumber())
  372. }
  373. }
  374. }
  375. if(chatClk(owner())){
  376. Said=lastSaid():lower():explode(" ")
  377. Cmd=Said[1,string]
  378. if(Cmd=="!remain"){
  379. if(lastSpoke()==owner()){
  380. if(R1:isShipment()){print(R1:shipmentName()+" - "+R1:shipmentAmount())}
  381. if(R2:isShipment()){print(R2:shipmentName()+" - "+R2:shipmentAmount())}
  382. if(R3:isShipment()){print(R3:shipmentName()+" - "+R3:shipmentAmount())}
  383. if(R4:isShipment()){print(R4:shipmentName()+" - "+R4:shipmentAmount())}
  384. if(R5:isShipment()){print(R5:shipmentName()+" - "+R5:shipmentAmount())}
  385. if(R6:isShipment()){print(R6:shipmentName()+" - "+R6:shipmentAmount())}
  386. }
  387. }
  388. }
  389.  
  390. ###############STARTSIDE###################################################
  391. if(~User & User){
  392. if(S==1){
  393. if(EGP:egpButton(20, User)){
  394. if(User:athdown()){
  395. if(Admusr){
  396. EGP:egpColor(15, vec4(150,150,150, 100))
  397. Admusr=0
  398. }
  399. else{
  400. Admusr=1
  401. EGP:egpColor(15, vec4(255,255,255, 150))
  402. }
  403. }
  404. }
  405. elseif(EGP:egpButton(1, User)){
  406. timer("FinalName", 100)
  407. NameLel="-"
  408. PassLel="-"
  409. CurUser=User
  410. FinalName=CurUser:name():explode("")
  411. FinalPass="******":explode("")
  412. S = 21
  413. }
  414. }
  415. }
  416. if(clk("FinalName")&S==21){
  417. if(NameLel:length()<=FinalName:count()){
  418. NameLel=NameLel+FinalName[NameLel:length(),string]
  419. EGP:egpSetText(18,NameLel:sub(2))
  420. timer("FinalName", 100)
  421. }
  422. else{timer("FinalPass",300)}
  423. }
  424. if(clk("FinalPass")){
  425. if(PassLel:length()<=FinalPass:count()){
  426. PassLel=PassLel+FinalPass[PassLel:length(),string]
  427. EGP:egpSetText(19,PassLel:sub(2))
  428. timer("FinalPass", 200)
  429. }
  430. else
  431. {
  432. timer("drawHejsa", 500)
  433. FinalHejsa="Velkommen":explode("")
  434. Hejsa="-"
  435. FinalHejsa2=CurUser:name():explode("")
  436. Hejsa2="-"
  437. }
  438. }
  439. ###############AFSTANDSMAALER##############################################
  440. if(clk("Afstand") | clk("CheckDist")){
  441. if(S>1){
  442. Dist=CurUser:pos():distance(EGP:entity():pos())
  443. if(Dist>150){timer("drawfirst",500)}
  444. timer("Afstand",2000)
  445. }
  446. }
  447. ###############SIDE2#######################################################
  448. if(clk("Hejsa")){
  449. if(S==2){
  450. if(Hejsa:length()<=FinalHejsa:count()){
  451. Hejsa=Hejsa+FinalHejsa[Hejsa:length(),string]
  452. EGP:egpSetText(3,Hejsa:sub(2))
  453. timer("Hejsa", 70)
  454. }
  455. else{timer("Hejsa2",90)}
  456. }
  457. }
  458. if(clk("Hejsa2")){
  459. if(S==2){
  460. if(Hejsa2:length()<=FinalHejsa2:count()){
  461. Hejsa2=Hejsa2+FinalHejsa2[Hejsa2:length(),string]
  462. EGP:egpSetText(4,Hejsa2:sub(2))
  463. timer("Hejsa2", 70)
  464. }
  465. else{timer("drawBase",500)}
  466. }
  467. }
  468. ###############TIMERS######################################################
  469. if(clk("drawBase")){
  470. resetChecks()
  471. S=0
  472. EGP:drawBase()
  473. timer("MakeDemGuns",400)
  474. timer("drawGuns",700)
  475. }
  476.  
  477. if(clk("drawHejsa")){
  478. EGP:drawHejsa()
  479. }
  480.  
  481. if(clk("MakeDemGuns")){
  482. EGP:drawWeaponList()
  483. addCursor()
  484. }
  485.  
  486. if(clk("drawGuns")){
  487. S = 3
  488. EGP:drawGuns()
  489. }
  490. if(clk("drawfirst")){
  491. S=0
  492. EGP:drawLogin()
  493. resetChecks()
  494. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement