- if(first()) {
- ##INDSTILLINGER
- Profit = 500
- ##############
- setName("------------------------
- Gunshop
- By
- Rasmusss
- ------------------------")
- if(first() | ~E & E | duped() | dupefinished())
- {
- 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 number entity:wepPrice()
- {
- if(This:isShipment()){
- return This:shipmentPrice()+Profit
- }else{return 0}
- }
- function string entity:wepName()
- {
- if(This:isShipment()){
- return This:shipmentName()
- }else{return "Udsolgt"}
- }
- }
- function wirelink:drawHome(){
- E:egpClear()
- E:egpBox(1,vec2(256,256),vec2(512,512)) E:egpColor(1,44,62,80,75)
- E:egpBox(2,vec2(256,25),vec2(512,50)) E:egpAlign(2,1,1) E:egpColor(2,127,140,141,75)
- E:egpBox(3,vec2(256,47),vec2(512,5)) E:egpAlign(3,1,1)
- E:egpText(4,"Velkommen!",vec2(256,25)) E:egpAlign(4,1,1) E:egpFont(4,"Courier New") E:egpSize(4,35)
- E:egpText(5,"apology",vec2(256,256)) E:egpAlign(5,1,1) E:egpFont(5,"Courier New") E:egpSize(5,35)
- E:egpBox(6,vec2(256,276),vec2(150,3))
- E:egpBox(7,vec2(256,492),vec2(512,40)) E:egpColor(7,127,140,141,75)
- E:egpBox(8,vec2(256,470),vec2(512,5)) E:egpAlign(8,1,1)
- E:egpText(9,"Login",vec2(256,492)) E:egpAlign(9,1,1) E:egpFont(9,"Courier New") E:egpSize(9,35)
- S = 1
- }
- function wirelink:drawLogin(){
- E:egpClear()
- E:egpBox(1,vec2(256,256),vec2(512,512)) E:egpColor(1,44,62,80,75)
- E:egpText(2,"Velkommen!",vec2(256,25)) E:egpAlign(2,1,1) E:egpFont(2,"Courier New") E:egpSize(2,35)
- E:egpText(3,"Her ser du vores udvalg",vec2(256,70)) E:egpAlign(3,1,1) E:egpFont(3,"Courier New") E:egpSize(3,30)
- E:egpBox(4,vec2(256,140),vec2(300,30))
- E:egpBox(5,vec2(256,190),vec2(300,30))
- E:egpBox(6,vec2(256,240),vec2(300,30))
- E:egpBox(7,vec2(256,290),vec2(300,30))
- E:egpBox(8,vec2(256,340),vec2(300,30))
- E:egpBox(9,vec2(256,390),vec2(300,30))
- E:egpBox(10,vec2(256,492),vec2(512,40)) E:egpColor(10,127,140,141,75)
- E:egpBox(11,vec2(256,470),vec2(512,5)) E:egpAlign(11,1,1)
- E:egpText(12,"Logud",vec2(256,492)) E:egpAlign(12,1,1) E:egpFont(12,"Courier New") E:egpSize(12,35)
- E:egpText(13,R1:wepName():sub(0,8)+" - "+R1:wepPrice()+",-",vec2(256,140)) E:egpAlign(13,1,1) E:egpFont(13,"Courier New") E:egpSize(13,30) E:egpColor(13,41,128,185,150)
- E:egpText(14,R2:wepName():sub(0,8)+" - "+R2:wepPrice()+",-",vec2(256,190)) E:egpAlign(14,1,1) E:egpFont(14,"Courier New") E:egpSize(14,30) E:egpColor(14,41,128,185,150)
- E:egpText(15,R3:wepName():sub(0,8)+" - "+R3:wepPrice()+",-",vec2(256,240)) E:egpAlign(15,1,1) E:egpFont(15,"Courier New") E:egpSize(15,30) E:egpColor(15,41,128,185,150)
- E:egpText(16,R4:wepName():sub(0,8)+" - "+R4:wepPrice()+",-",vec2(256,290)) E:egpAlign(16,1,1) E:egpFont(16,"Courier New") E:egpSize(16,30) E:egpColor(16,41,128,185,150)
- E:egpText(17,R5:wepName():sub(0,8)+" - "+R5:wepPrice()+",-",vec2(256,340)) E:egpAlign(17,1,1) E:egpFont(17,"Courier New") E:egpSize(17,30) E:egpColor(17,41,128,185,150)
- E:egpText(18,R6:wepName():sub(0,8)+" - "+R6:wepPrice()+",-",vec2(256,390)) E:egpAlign(18,1,1) E:egpFont(18,"Courier New") E:egpSize(18,30) E:egpColor(18,41,128,185,150)
- S = 2
- }
- E:drawHome()
- }
- function number wirelink:egpButton(Index:number,Player:entity){
- Pos=This:egpPos(Index)
- Size=This:egpSize(Index)/2
- return inrange(This:egpCursor(Player),Pos-Size,Pos+Size)
- }
- if(S == 1 & ops() < 150){
- if(E:egpButton(7,U)){E:drawLogin()}
- }
- elseif(S == 2 & ops() < 150){
- if(E:egpButton(10,U)){E:drawHome()}
- }
- if(S == 2) {
- if(egpButton(4,U)){moneyRequest(U,R1:wepPrice())
- }
- }