Garry's Mod
Expression 2 Code: Expression 2 Shop
Submitted by that1nub, 09-11-2017, 02:27 AM, Thread ID: 59487
Thread Closed
09-11-2017, 02:27 AM
#1 If you have codes you would like to sell on a DarkRP server, then you can use this code. It should work by default. The only thing that will prevent it from working is the fact that you need the steam workshop addon to request money. If you wan't me to make a code, then reply to this post!
Code:
#[
Wiring:
KEY: Expression -> Egp
EGP [WIRELINK] -> wirelink [WIRELINK]
User [ENTITY] -> User [ENTITY]
]#
@name EGP Expression 2 Shop
@inputs EGP:wirelink User:entity
@persist SE2 [E2 E2D E2C]:array AFKStatus
Cursor = EGP:egpCursor(User)
if(first()|duped()|dupefinished()){
E2[1,string] = "NONE"
E2D[1,string] = "No expression 2 here yet"
E2C[1,number] = 0
E2[2,string] = "NONE"
E2D[2,string] = "No expression 2 here yet."
E2C[2,number] = 0
E2[3,string] = "NONE"
E2D[3,string] = "No expression 2 here yet."
E2C[3,number] = 0
E2[4,string] = "NONE"
E2D[4,string] = "No expression 2 here yet."
E2C[4,number] = 0
E2[5,string] = "NONE"
E2D[5,string] = "No expression 2 here yet."
E2C[5,number] = 0
E2[6,string] = "NONE"
E2D[6,string] = "No expression 2 here yet."
E2C[6,number] = 0
E2[7,string] = "NONE"
E2D[7,string] = "No expression 2 here yet."
E2C[7,number] = 0
E2[8,string] = "NONE"
E2D[8,string] = "No expression 2 here yet."
E2C[8,number] = 0
E2[9,string] = "NONE"
E2D[9,string] = "No expression 2 here yet."
E2C[9,number] = 0
E2[10,string] = "NONE"
E2D[10,string] = "No expression 2 here yet."
E2C[10,number] = 0
E2[11,string] = "NONE"
E2D[11,string] = "No expression 2 here yet."
E2C[11,number] = 0
E2[12,string] = "NONE"
E2D[12,string] = "No expression 2 here yet."
E2C[12,number] = 0
E2[13,string] = "NONE"
E2D[13,string] = "No expression 2 here yet."
E2C[13,number] = 0
# Button Press Function
function number button(N){
return inrange(Cursor,EGP:egpPos(N),EGP:egpPos(N)+EGP:egpSize(N))
}
# Background
EGP:egpClear()
EGP:egpDrawTopLeft(1)
EGP:egpBox(1,vec2(0),vec2(512))
EGP:egpColor(1,vec(0,150,255))
EGP:egpBox(2,vec2(5),vec2(502))
EGP:egpColor(2,vec(50))
EGP:egpTextLayout(3,owner():name()+"'s expression 2 shop",vec2(5),vec2(502,30))
EGP:egpSize(3,25)
EGP:egpAlign(3,1,1)
# E2 1
EGP:egpBox(4,vec2(10,35),vec2(206,20))
EGP:egpColor(4,vec(0,150,255))
EGP:egpTextLayout(5,E2[1,string],EGP:egpPos(4),EGP:egpSize(4))
EGP:egpAlign(5,1,1)
# E2 2
EGP:egpBox(6,vec2(10,70),vec2(206,20))
EGP:egpColor(6,vec(0,150,255))
EGP:egpTextLayout(7,E2[2,string],EGP:egpPos(6),EGP:egpSize(6))
EGP:egpAlign(7,1,1)
# E2 3
EGP:egpBox(8,vec2(10,105),vec2(206,20))
EGP:egpColor(8,vec(0,150,255))
EGP:egpTextLayout(9,E2[3,string],EGP:egpPos(8),EGP:egpSize(8))
EGP:egpAlign(9,1,1)
# E2 4
EGP:egpBox(10,vec2(10,140),vec2(206,20))
EGP:egpColor(10,vec(0,150,255))
EGP:egpTextLayout(11,E2[4,string],EGP:egpPos(10),EGP:egpSize(10))
EGP:egpAlign(11,1,1)
# E2 5
EGP:egpBox(12,vec2(10,175),vec2(206,20))
EGP:egpColor(12,vec(0,150,255))
EGP:egpTextLayout(13,E2[5,string],EGP:egpPos(12),EGP:egpSize(12))
EGP:egpAlign(13,1,1)
# E2 6
EGP:egpBox(14,vec2(10,210),vec2(206,20))
EGP:egpColor(14,vec(0,150,255))
EGP:egpTextLayout(15,E2[6,string],EGP:egpPos(14),EGP:egpSize(14))
EGP:egpAlign(15,1,1)
# E2 7
EGP:egpBox(16,vec2(10,245),vec2(206,20))
EGP:egpColor(16,vec(0,150,255))
EGP:egpTextLayout(17,E2[7,string],EGP:egpPos(16),EGP:egpSize(16))
EGP:egpAlign(17,1,1)
# E2 8
EGP:egpBox(18,vec2(10,280),vec2(206,20))
EGP:egpColor(18,vec(0,150,255))
EGP:egpTextLayout(19,E2[8,string],EGP:egpPos(18),EGP:egpSize(18))
EGP:egpAlign(19,1,1)
# E2 9
EGP:egpBox(20,vec2(10,315),vec2(206,20))
EGP:egpColor(20,vec(0,150,255))
EGP:egpTextLayout(21,E2[9,string],EGP:egpPos(20),EGP:egpSize(20))
EGP:egpAlign(21,1,1)
# E2 10
EGP:egpBox(22,vec2(10,350),vec2(206,20))
EGP:egpColor(22,vec(0,150,255))
EGP:egpTextLayout(23,E2[10,string],EGP:egpPos(22),EGP:egpSize(22))
EGP:egpAlign(23,1,1)
# E2 11
EGP:egpBox(24,vec2(10,385),vec2(206,20))
EGP:egpColor(24,vec(0,150,255))
EGP:egpTextLayout(25,E2[11,string],EGP:egpPos(24),EGP:egpSize(24))
EGP:egpAlign(25,1,1)
# E2 12
EGP:egpBox(26,vec2(10,420),vec2(206,20))
EGP:egpColor(26,vec(0,150,255))
EGP:egpTextLayout(27,E2[12,string],EGP:egpPos(26),EGP:egpSize(26))
EGP:egpAlign(27,1,1)
# E2 13
EGP:egpBox(28,vec2(10,455),vec2(206,20))
EGP:egpColor(28,vec(0,150,255))
EGP:egpTextLayout(29,E2[13,string],EGP:egpPos(28),EGP:egpSize(28))
EGP:egpAlign(29,1,1)
# Remove this / Edit this and I will FUCK your family
EGP:egpTextLayout(30,"Originally created by that1nub",vec2(10,480),vec2(206,20))
EGP:egpSize(30,15)
EGP:egpAlign(30,1,1)
# Description Box
EGP:egpLine(31,vec2(226,35),vec2(226,502))
EGP:egpLine(32,vec2(226,502),vec2(502))
EGP:egpLine(33,vec2(502),vec2(502,35))
EGP:egpLine(34,vec2(502,35),vec2(226,35))
EGP:egpLine(35,vec2(226,85),vec2(502,85))
EGP:egpLine(36,vec2(226,452),vec2(502,452))
EGP:egpTextLayout(37,"$Cost:",vec2(231,457),vec2(261,40))
EGP:egpAlign(37,0,1)
EGP:egpBox(38,vec2(397,457),vec2(100,40))
EGP:egpColor(38,vec(0,150,255))
EGP:egpTextLayout(39,"Purchase",EGP:egpPos(38),EGP:egpSize(38))
EGP:egpAlign(39,1,1)
EGP:egpTextLayout(40,"Description",vec2(231,90),vec2(502-231,447))
EGP:egpTextLayout(41,"Title",vec2(231,40),vec2(502-231,40))
EGP:egpAlign(41,1,1)
EGP:egpSize(41,30)
}
# Button Presses
if(button(4)){
SE2 = 1
EGP:egpSetText(41,E2[1,string])
EGP:egpSetText(40,E2D[1,string])
EGP:egpSetText(37,"$Cost: "+E2C[1,number]:toString())
}
if(button(6)){
SE2 = 2
EGP:egpSetText(41,E2[2,string])
EGP:egpSetText(40,E2D[2,string])
EGP:egpSetText(37,"$Cost: "+E2C[2,number]:toString())
}
if(button(8)){
SE2 = 3
EGP:egpSetText(41,E2[3,string])
EGP:egpSetText(40,E2D[3,string])
EGP:egpSetText(37,"$Cost: "+E2C[3,number]:toString())
}
if(button(10)){
SE2 = 4
EGP:egpSetText(41,E2[4,string])
EGP:egpSetText(40,E2D[4,string])
EGP:egpSetText(37,"$Cost: "+E2C[4,number]:toString())
}
if(button(12)){
SE2 = 5
EGP:egpSetText(41,E2[5,string])
EGP:egpSetText(40,E2D[5,string])
EGP:egpSetText(37,"$Cost: "+E2C[5,number]:toString())
}
if(button(14)){
SE2 = 6
EGP:egpSetText(41,E2[6,string])
EGP:egpSetText(40,E2D[6,string])
EGP:egpSetText(37,"$Cost: "+E2C[6,number]:toString())
}
if(button(16)){
SE2 = 7
EGP:egpSetText(41,E2[7,string])
EGP:egpSetText(40,E2D[7,string])
EGP:egpSetText(37,"$Cost: "+E2C[7,number]:toString())
}
if(button(18)){
SE2 = 8
EGP:egpSetText(41,E2[8,string])
EGP:egpSetText(40,E2D[8,string])
EGP:egpSetText(37,"$Cost: "+E2C[8,number]:toString())
}
if(button(20)){
SE2 = 9
EGP:egpSetText(41,E2[9,string])
EGP:egpSetText(40,E2D[9,string])
EGP:egpSetText(37,"$Cost: "+E2C[9,number]:toString())
}
if(button(22)){
SE2 = 10
EGP:egpSetText(41,E2[10,string])
EGP:egpSetText(40,E2D[10,string])
EGP:egpSetText(37,"$Cost: "+E2C[10,number]:toString())
}
if(button(24)){
SE2 = 11
EGP:egpSetText(41,E2[11,string])
EGP:egpSetText(40,E2D[11,string])
EGP:egpSetText(37,"$Cost: "+E2C[11,number]:toString())
}
if(button(26)){
SE2 = 12
EGP:egpSetText(41,E2[12,string])
EGP:egpSetText(40,E2D[12,string])
EGP:egpSetText(37,"$Cost: "+E2C[12,number]:toString())
}
if(button(28)){
SE2 = 13
EGP:egpSetText(41,E2[13,string])
EGP:egpSetText(40,E2D[13,string])
EGP:egpSetText(37,"$Cost: "+E2C[13,number]:toString())
}
if(button(38)){
if(SE2 == 1){moneyRequest(User,E2C[1,number])}
elseif(SE2 == 2){moneyRequest(User,E2C[2,number])}
elseif(SE2 == 3){moneyRequest(User,E2C[3,number])}
elseif(SE2 == 4){moneyRequest(User,E2C[4,number])}
elseif(SE2 == 5){moneyRequest(User,E2C[5,number])}
elseif(SE2 == 6){moneyRequest(User,E2C[6,number])}
elseif(SE2 == 7){moneyRequest(User,E2C[7,number])}
elseif(SE2 == 8){moneyRequest(User,E2C[8,number])}
elseif(SE2 == 9){moneyRequest(User,E2C[9,number])}
elseif(SE2 == 10){moneyRequest(User,E2C[10,number])}
elseif(SE2 == 11){moneyRequest(User,E2C[11,number])}
elseif(SE2 == 12){moneyRequest(User,E2C[12,number])}
elseif(SE2 == 13){moneyRequest(User,E2C[13,number])}
}
# When they send money
if(moneyClk()){
if(SE2 == 1){hint(moneyClkPlayer():name()+" has requested '"+E2[1,string]+"' for $"+E2C[1,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[1,string]+"' for $"+E2C[1,number]:toString())}
elseif(SE2 == 2){hint(moneyClkPlayer():name()+" has requested '"+E2[2,string]+"' for $"+E2C[2,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[2,string]+"' for $"+E2C[2,number]:toString())}
elseif(SE2 == 3){hint(moneyClkPlayer():name()+" has requested '"+E2[3,string]+"' for $"+E2C[3,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[3,string]+"' for $"+E2C[3,number]:toString())}
elseif(SE2 == 4){hint(moneyClkPlayer():name()+" has requested '"+E2[4,string]+"' for $"+E2C[4,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[4,string]+"' for $"+E2C[4,number]:toString())}
elseif(SE2 == 5){hint(moneyClkPlayer():name()+" has requested '"+E2[5,string]+"' for $"+E2C[5,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[5,string]+"' for $"+E2C[5,number]:toString())}
elseif(SE2 == 6){hint(moneyClkPlayer():name()+" has requested '"+E2[6,string]+"' for $"+E2C[6,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[6,string]+"' for $"+E2C[6,number]:toString())}
elseif(SE2 == 7){hint(moneyClkPlayer():name()+" has requested '"+E2[7,string]+"' for $"+E2C[7,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[7,string]+"' for $"+E2C[7,number]:toString())}
elseif(SE2 == 8){hint(moneyClkPlayer():name()+" has requested '"+E2[8,string]+"' for $"+E2C[8,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[8,string]+"' for $"+E2C[8,number]:toString())}
elseif(SE2 == 9){hint(moneyClkPlayer():name()+" has requested '"+E2[9,string]+"' for $"+E2C[9,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[9,string]+"' for $"+E2C[9,number]:toString())}
elseif(SE2 == 10){hint(moneyClkPlayer():name()+" has requested '"+E2[10,string]+"' for $"+E2C[10,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[10,string]+"' for $"+E2C[10,number]:toString())}
elseif(SE2 == 11){hint(moneyClkPlayer():name()+" has requested '"+E2[11,string]+"' for $"+E2C[11,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[11,string]+"' for $"+E2C[11,number]:toString())}
elseif(SE2 == 12){hint(moneyClkPlayer():name()+" has requested '"+E2[12,string]+"' for $"+E2C[12,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[12,string]+"' for $"+E2C[12,number]:toString())}
elseif(SE2 == 13){hint(moneyClkPlayer():name()+" has requested '"+E2[13,string]+"' for $"+E2C[13,number]:toString(),20) print(_HUD_PRINTCENTER,moneyClkPlayer():name()+" has requested '"+E2[13,string]+"' for $"+E2C[13,number]:toString())}
}
# Setting Font
for(I = 1,EGP:egpNumObjects()){
EGP:egpFont(I,"Arial")
}
Users browsing this thread: 1 Guest(s)