Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name EMBRACE xop
- @inputs [EGP, Emitter]:wirelink User:entity [R1 R2 R3 R4 R5 R6]:entity
- @outputs U1 U2 U3 U4 U5 U6
- @persist S:normal CurUser:entity Profit BPris:normal Admusr
- @persist [NameLel PassLel Hejsa Hejsa2 IndL]:string [FinalName FinalPass FinalHejsa FinalHejsa2 FinalIndL Checks]:array CW:table
- @trigger User
- if(chatClk()&!chatClk(owner())){exit()}
- if(duped() | dupefinished()){reset()}
- if(first()){
- runOnChat(1)
- setName("- EMBRACE -
- - Version: 2.1 -")
- ##INDSTILNINGER
- Profit = 600
- ###############
- function number roundmoyly(Nm1,Nm2){
- return ceil(Nm1/Nm2)*Nm2
- }
- function void addCursor(){
- 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)))
- EGP:egpColor(999,0,0,0,200)
- EGP:egpParentToCursor(999)
- }
- function number wirelink:egpButton(Idx:number,Ply:entity){
- TL = This:egpPos(Idx) - This:egpSize(Idx) / 2 * (0 ? 0 : 1)
- BR = This:egpPos(Idx) + This:egpSize(Idx) / (0 ? 1 : 2)
- Cur = This:egpCursor(Ply) return inrange(Cur, TL, BR) exit()
- }
- function void resetChecks(){
- I=1
- while(I<=6){
- Checks[I,number]=0
- I++
- }
- }
- function string entity:getWepName(){
- if(This:isShipment()){
- Name=This:shipmentName()
- return Name:trim()
- }
- else{return "Udsolgt"}
- }
- function number entity:getWepPrice(){
- if(This:isShipment()){
- Name=This:shipmentName()
- Price=This:shipmentPrice()
- return roundmoyly(Price,200)+Profit
- }
- else{return 0}
- }
- function string getWepdrawName(Nm){
- return CW[Nm,array][1,string]+" - "+CW[Nm,array][2,number]+",-"
- }
- function void wirelink:drawEmitter()
- {
- This:egpClear()
- This:egpText(1, "E M B R A C E - G U N S H O P", vec2(256,295))
- This:egpSize(1, 50)
- This:egpAlign(1, 1,1)
- This:egpFont(1, "Courier New")
- }
- Emitter:drawEmitter()
- function void wirelink:drawLogin(){
- S = 1
- Admusr=0
- This:egpClear()
- This:egpBox(1, vec2(256,256), vec2(512,512))
- This:egpMaterial(1, "console/background06")
- This:egpBox(2, vec2(256,256), vec2(512,512))
- This:egpColor(2, vec4(51,52,59, 180))
- ##EMBRACE LOGO
- #HvidBoks
- This:egpBox(3, vec2(256,120), vec2(80,80))
- This:egpAngle(3, 45)
- #Outline
- This:egpBoxOutline(4, vec2(256,120), vec2(64,64))
- This:egpColor(4, vec(33,33,33))
- This:egpAngle(4, 45)
- This:egpSize(4, 3)
- #MIDTERSTYKKE
- This:egpBox(5, vec2(256,120), vec2(3,36))
- This:egpColor(5, vec(33,33,33))
- #Nederst
- This:egpBox(6, vec2(256,130), vec2(21,3))
- This:egpColor(6, vec(33,33,33))
- #Midterst
- This:egpBox(7, vec2(256,120), vec2(21,3))
- This:egpColor(7, vec(33,33,33))
- #Overst
- This:egpBox(8, vec2(256,110), vec2(21,3))
- This:egpColor(8, vec(33,33,33))
- ##TEKST
- This:egpText(9, "E M B R A C E", vec2(256,195))
- This:egpAlign(9, 1,1)
- This:egpSize(9, 25)
- This:egpFont(9, "Verdana")
- #Email
- This:egpBox(10, vec2(256,290), vec2(250,45))
- This:egpColor(10, vec4(100,100,100, 100))
- This:egpBox(11, vec2(176,290), vec2(1,37))
- This:egpColor(11, vec4(150,150,150, 100))
- This:egpText(12, "@", vec2(154,288))
- This:egpAlign(12, 1,1)
- This:egpSize(12, 35)
- This:egpFont(12, "Roboto")
- This:egpColor(12, vec4(150,150,150, 100))
- #Kode
- This:egpBox(13, vec2(256,350), vec2(250,45))
- This:egpColor(13, vec4(100,100,100, 100))
- This:egpBox(14, vec2(176,350), vec2(1,37))
- This:egpColor(14, vec4(150,150,150, 100))
- This:egpText(15, "#", vec2(154,348))
- This:egpAlign(15, 1,1)
- This:egpSize(15, 35)
- This:egpFont(15, "Verdana")
- This:egpColor(15, vec4(150,150,150, 100))
- ##LoginKnap
- This:egpBox(16, vec2(256,420), vec2(250,45))
- This:egpText(17, "LOG IND", vec2(256,420))
- This:egpAlign(17, 1,1)
- This:egpSize(17, 25)
- This:egpFont(17, "Roboto")
- This:egpColor(17, vec(33,33,33))
- NameLel=""
- This:egpText(18, NameLel, vec2(190,290))
- This:egpAlign(18, 0,1)
- This:egpSize(18, 22)
- This:egpColor(18, vec4(150,150,150, 100))
- This:egpFont(18, "Verdana")
- PassLel=""
- This:egpText(19, PassLel, vec2(190,350))
- This:egpAlign(19, 0,1)
- This:egpSize(19, 22)
- This:egpColor(19, vec4(150,150,150, 100))
- This:egpFont(19, "Verdana")
- This:egpBox(20, vec2(152,349), vec2(42,42))
- This:egpColor(20, vec4(255,255,255, 0))
- addCursor()
- }
- function number entity:athdown(){
- if(This:pos():distance(EGP:entity():pos())<400){
- Ahlst=array()
- Ahlst:pushString("STEAM_0:0:56939043")
- Ahlst:pushString("STEAM_0:0:37262415")
- Ahlst:pushString("STEAM_0:0:18275106")
- Ahlst:pushString("STEAM_0:0:5215442")
- Ahlst:pushString("STEAM_0:1:149810095")
- Ahlst:pushString(owner():steamID())
- I=1
- C=Ahlst:count()
- Authd=0
- while(I<=C){
- if(Ahlst[I,string]==This:steamID()){
- Authd=1
- }
- I++
- }
- if(I>C){
- return Authd
- }
- }
- }
- function void wirelink:drawHejsa(){
- S = 2
- This:egpClear()
- This:egpBox(1, vec2(256,256), vec2(512,512))
- This:egpMaterial(1, "console/background06")
- This:egpBox(2, vec2(256,256), vec2(512,512))
- This:egpColor(2, vec4(51,52,59, 180))
- This:egpText(3, Hejsa, vec2(256,240))
- This:egpAlign(3, 1,1)
- This:egpSize(3, 35)
- This:egpColor(3, vec4(255,255,255,255))
- This:egpFont(3, "Courier New")
- This:egpText(4, Hejsa2, vec2(256,270))
- This:egpAlign(4, 1,1)
- This:egpSize(4, 35)
- This:egpColor(4, vec4(255,255,255,255))
- This:egpFont(4, "Courier New")
- CW[1,array]=array(R1:getWepName(),R1:getWepPrice(),R1:shipmentAmount(),1)
- CW[2,array]=array(R2:getWepName(),R2:getWepPrice(),R2:shipmentAmount(),2)
- CW[3,array]=array(R3:getWepName(),R3:getWepPrice(),R3:shipmentAmount(),3)
- CW[4,array]=array(R4:getWepName(),R4:getWepPrice(),R4:shipmentAmount(),4)
- CW[5,array]=array(R5:getWepName(),R5:getWepPrice(),R5:shipmentAmount(),5)
- CW[6,array]=array(R6:getWepName(),R6:getWepPrice(),R6:shipmentAmount(),6)
- timer("Hejsa", 200)
- }
- function void wirelink:drawBase()
- {
- This:egpClear()
- This:egpBox(1, vec2(256,256), vec2(512,512))
- This:egpMaterial(1, "console/background06")
- This:egpBox(2, vec2(256,256), vec2(512,512))
- This:egpColor(2, vec4(51,52,59, 180))
- ##EMBRACELOGO
- This:egpText(3, "E M B R A C E", vec2(256,30))
- This:egpAlign(3, 1,1)
- This:egpSize(3, 25)
- This:egpFont(3, "Verdana")
- BPris=0
- ##BETALEREN
- This:egpBox(99, vec2(256,485), vec2(356,50))
- This:egpColor(99, vec(230,230,230))
- This:egpText(100, ""+BPris, vec2(256,485))
- This:egpAlign(100, 1,1)
- This:egpSize(100, 35)
- This:egpFont(100, "Courier New")
- This:egpColor(100, vec(33,33,33))
- #KR
- This:egpBox(101, vec2(409,485), vec2(50,50))
- This:egpColor(101, vec(100,100,100))
- This:egpText(102, "KR", vec2(410,485))
- This:egpAlign(102, 1,1)
- This:egpSize(102, 30)
- This:egpFont(102, "Courier New")
- ##UNDERBOKS
- This:egpBox(103, vec2(256,511), vec2(356,2))
- This:egpColor(103, vec(157,118,79))
- ##----PRIS----##
- This:egpText(104, "- - - - - - - - - - - PRIS - - - - - - - - - - -", vec2(256,453))
- This:egpAlign(104, 1,1)
- This:egpSize(104, 14)
- This:egpFont(104, "Courier New")
- ##Tilbage
- This:egpBox(105, vec2(256,30), vec2(136,25))
- This:egpColor(105, vec4(255,255,255, 1))
- timer("Afstand", 2000)
- }
- function void wirelink:drawGuns(){
- I=1
- while(I<=6){
- Pos=I*60
- This:egpText(24+I, getWepdrawName(I), vec2(100,20+Pos))
- This:egpAlign(24+I, 0,1)
- This:egpFont(24+I, "Courier New",25)
- I++
- }
- }
- function void wirelink:drawWeaponList(){
- I=1
- while(I<=6){
- Pos=I*60
- This:egpBox(13+I, vec2(230,20+Pos), vec2(304,50))
- This:egpColor(13+I, vec4(100,100,100, 150))
- This:egpText(24+I, getWepdrawName(I), vec2(100,20+Pos))
- This:egpAlign(24+I, 0,1)
- This:egpFont(24+I, "Courier New",25)
- This:egpBoxOutline(35+I, vec2(410,20+Pos), vec2(50,50))
- This:egpSize(35+I, 2)
- This:egpLine(46+I, vec2(427,83-80+Pos), vec2(393,117-80+Pos))
- This:egpSize(46+I, 2)
- This:egpAlpha(46+I, 0)
- This:egpLine(57+I, vec2(393,83-80+Pos), vec2(427,117-80+Pos))
- This:egpSize(57+I, 2)
- This:egpAlpha(57+I, 0)
- This:egpBox(68+I, vec2(256,20+Pos), vec2(512,50))
- This:egpAlpha(68+I,0)
- I++
- }
- }
- function void calculateprice(){
- I=1
- C=CW:count()
- CalcVal=0
- while(I<=C){
- if(Checks[I,number]==1){CalcVal+=CW[I,array][2,number]}
- I++
- }
- if(I>C){
- BPris=CalcVal
- if(S==3){EGP:egpSetText(100,BPris+"")}
- }
- }
- function void toggleCheck(Nm){
- if(Checks[Nm,number]==1){
- Checks[Nm,number]=0
- EGP:egpAlpha(57+Nm, 0)
- EGP:egpAlpha(46+Nm, 0)
- calculateprice()
- }
- else{
- Checks[Nm,number]=1
- EGP:egpAlpha(57+Nm, 255)
- EGP:egpAlpha(46+Nm, 255)
- calculateprice()
- }
- }
- EGP:drawLogin()
- }
- if(~User & User){
- if(ops()<100) {
- if(CurUser==User & S==3){
- if(EGP:egpButton(99, User)&BPris>0){ #Payment
- if(Admusr){timer("spawnthewepsy",0)} else{
- moneyRequest(CurUser,BPris,"MobilePay")}
- }
- if(EGP:egpButton(69,User)){toggleCheck(1)}
- if(EGP:egpButton(70,User)){toggleCheck(2)}
- if(EGP:egpButton(71,User)){toggleCheck(3)}
- if(EGP:egpButton(72,User)){toggleCheck(4)}
- if(EGP:egpButton(73,User)){toggleCheck(5)}
- if(EGP:egpButton(74,User)){toggleCheck(6)}
- if(EGP:egpButton(105,User)){timer("drawfirst",400)}
- }
- }
- }
- if(moneyClk("MobilePay") | clk("spawnthewepsy")){
- if(Checks[1,number]==1){
- U1 = 1
- }
- if(Checks[2,number]==1){
- U2 = 1
- }
- if(Checks[3,number]==1){
- U3 = 1
- }
- if(Checks[4,number]==1){
- U4 = 1
- }
- if(Checks[5,number]==1){
- U5 = 1
- }
- if(Checks[6,number]==1){
- U6 = 1
- }
- timer("resetBuy", 100)
- timer("drawfirst",400)
- }
- if(clk("resetBuy")){
- U1 = 0
- U2 = 0
- U3 = 0
- U4 = 0
- U5 = 0
- U6 = 0
- resetChecks()
- BPris = 0
- }
- #####CHATCOMMANDS######################
- if(chatClk(owner())){
- Said=lastSaid():lower():explode(" ")
- Cmd=Said[1,string]
- if(Cmd=="!profit"){
- if(lastSpoke()==owner()){
- Profit=Said[2,string]:toNumber()
- print("Satte profit til "+Said[2,string]:toNumber())
- }
- }
- }
- if(chatClk(owner())){
- Said=lastSaid():lower():explode(" ")
- Cmd=Said[1,string]
- if(Cmd=="!remain"){
- if(lastSpoke()==owner()){
- if(R1:isShipment()){print(R1:shipmentName()+" - "+R1:shipmentAmount())}
- if(R2:isShipment()){print(R2:shipmentName()+" - "+R2:shipmentAmount())}
- if(R3:isShipment()){print(R3:shipmentName()+" - "+R3:shipmentAmount())}
- if(R4:isShipment()){print(R4:shipmentName()+" - "+R4:shipmentAmount())}
- if(R5:isShipment()){print(R5:shipmentName()+" - "+R5:shipmentAmount())}
- if(R6:isShipment()){print(R6:shipmentName()+" - "+R6:shipmentAmount())}
- }
- }
- }
- ###############STARTSIDE###################################################
- if(~User & User){
- if(S==1){
- if(EGP:egpButton(20, User)){
- if(User:athdown()){
- if(Admusr){
- EGP:egpColor(15, vec4(150,150,150, 100))
- Admusr=0
- }
- else{
- Admusr=1
- EGP:egpColor(15, vec4(255,255,255, 150))
- }
- }
- }
- elseif(EGP:egpButton(1, User)){
- timer("FinalName", 100)
- NameLel="-"
- PassLel="-"
- CurUser=User
- FinalName=CurUser:name():explode("")
- FinalPass="******":explode("")
- S = 21
- }
- }
- }
- if(clk("FinalName")&S==21){
- if(NameLel:length()<=FinalName:count()){
- NameLel=NameLel+FinalName[NameLel:length(),string]
- EGP:egpSetText(18,NameLel:sub(2))
- timer("FinalName", 100)
- }
- else{timer("FinalPass",300)}
- }
- if(clk("FinalPass")){
- if(PassLel:length()<=FinalPass:count()){
- PassLel=PassLel+FinalPass[PassLel:length(),string]
- EGP:egpSetText(19,PassLel:sub(2))
- timer("FinalPass", 200)
- }
- else
- {
- timer("drawHejsa", 500)
- FinalHejsa="Velkommen":explode("")
- Hejsa="-"
- FinalHejsa2=CurUser:name():explode("")
- Hejsa2="-"
- }
- }
- ###############AFSTANDSMAALER##############################################
- if(clk("Afstand") | clk("CheckDist")){
- if(S>1){
- Dist=CurUser:pos():distance(EGP:entity():pos())
- if(Dist>150){timer("drawfirst",500)}
- timer("Afstand",2000)
- }
- }
- ###############SIDE2#######################################################
- if(clk("Hejsa")){
- if(S==2){
- if(Hejsa:length()<=FinalHejsa:count()){
- Hejsa=Hejsa+FinalHejsa[Hejsa:length(),string]
- EGP:egpSetText(3,Hejsa:sub(2))
- timer("Hejsa", 70)
- }
- else{timer("Hejsa2",90)}
- }
- }
- if(clk("Hejsa2")){
- if(S==2){
- if(Hejsa2:length()<=FinalHejsa2:count()){
- Hejsa2=Hejsa2+FinalHejsa2[Hejsa2:length(),string]
- EGP:egpSetText(4,Hejsa2:sub(2))
- timer("Hejsa2", 70)
- }
- else{timer("drawBase",500)}
- }
- }
- ###############TIMERS######################################################
- if(clk("drawBase")){
- resetChecks()
- S=0
- EGP:drawBase()
- timer("MakeDemGuns",400)
- timer("drawGuns",700)
- }
- if(clk("drawHejsa")){
- EGP:drawHejsa()
- }
- if(clk("MakeDemGuns")){
- EGP:drawWeaponList()
- addCursor()
- }
- if(clk("drawGuns")){
- S = 3
- EGP:drawGuns()
- }
- if(clk("drawfirst")){
- S=0
- EGP:drawLogin()
- resetChecks()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement