                  
@name Gun Shap
@inputs [TN_EGP]:wirelink [TN_User]:entity
@inputs [TN_StoredAmount TN_Updated TN_LastAmount]
@inputs [TN_R1 TN_R2 TN_R3 TN_R4 TN_R5 TN_R6 TN_R7 TN_R8]:entity
@outputs [TN_SpawnAmount]
@outputs [TN_U1 TN_U2 TN_U3 TN_U4 TN_U5 TN_U6 TN_U7 TN_U8]
#>----------------------------------------------------------------------------------------------------------------------------------<#  
@outputs [TN_FadeDoor]
#>----------------------------------------------------------------------------------------------------------------------------------<#  
@persist [TN_Menu]:string
#>----------------------------------------------------------------------------------------------------------------------------------<#  
@persist [TN_CSpam1 TN_CSpam2 TN_CSpam3 TN_CSpam4 TN_CSpam5 TN_CSpam6 TN_CSpam7 TN_CSpam8 TN_CSpam9 TN_CSpam10 TN_CSpam11]
#>----------------------------------------------------------------------------------------------------------------------------------<#  
@persist [TN_Price1 TN_Price2 TN_Price3 TN_Price4 TN_Price5 TN_Price6 TN_Price7 TN_Price8]
#>----------------------------------------------------------------------------------------------------------------------------------<#  
@persist [TN_Distance]
#>----------------------------------------------------------------------------------------------------------------------------------<#  
@trigger [TN_User] [TN_R1 TN_R2 TN_R3 TN_R4 TN_R5 TN_R6 TN_R7 TN_R8]
#>----------------------------------------------------------------------------------------------------------------------------------<#  
@model models/items/car_battery01.mdl
#>----------------------------------------------------------------------------------------------------------------------------------<#  
 
#[
 
   \  |             |          |                  |          |                  
  |\/ |   _` |   _` |   -_)     _ \  |  |   (_-<  | /  |  |   _|   _| _ \    \  
 _|  _| \__,_| \__,_| \___|   _.__/ \_, |   ___/ _\_\ \_, | \__| _| \___/ _| _|
                                    ___/              ___/        
]#
   
#---------------------------------#
#[><><><><>-------------<><><><><]#
#[><><><><>START OF CODE<><><><><]#
#[><><><><>-------------<><><><><]#
#---------------------------------#
 
#-----------------------------------#
#:Section 1 - Beginning Information:#
#-----------------------------------#
 
interval(2000)                                          
 
if(first()){
    TN_EGP:egpClear()
    TN_FadeDoor = 1
    TN_Distance = 35
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Welcome to TN.Shop! Please use !commands to view the list of valid commands. Made by skytron for ByB Community. Do not redistribute!")
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Reminder: When you place a new shipment in a Ranger Slot, remember to change/update the price!")
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(255,255,51)," A copyright message has been printed into your console. If you wish to share/modify TN.Shop (this E2), read the message.")
    setName("[Tron.Net] | TN.Shop |
Author:  skytron (STEAM_0:0:49611408)
Version: v1.0.0
License: Attribution-NonCommercial-ShareAlike 4.0 International")
 
#:License Information:#
 
print(_HUD_PRINTCONSOLE,
"Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
http://creativecommons.org/licenses/by-nc-sa/4.0/
 
You are free:
to Share: to copy, distribute and transmit the work
to Remix: to adapt the work")
 
print(_HUD_PRINTCONSOLE,
"Under the following conditions:
 
Attribution: You must attribute the work in the manner specified
by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).")
 
print(_HUD_PRINTCONSOLE,
"Noncommercial: You may not use this work for commercial purposes.
 
Share-Alike: If you alter, transform, or build upon this work, you may
distribute the resulting work only under the same or similar license to this one.")
         
#-----------------------------#
#:Section 2 - Anti CursorSpam:#
#-----------------------------#
 
    TN_CSpam1 = 0
    TN_CSpam2 = 0
    TN_CSpam3 = 0
    TN_CSpam4 = 0
    TN_CSpam5 = 0
    TN_CSpam6 = 0
    TN_CSpam7 = 0
    TN_CSpam8 = 0
    TN_CSpam9 = 0
    TN_CSpam10 = 0
    TN_CSpam11 = 0  
 
#----------------------------------#
#:Section 3 - Shipment Information:#
#----------------------------------#
 
        TN_ShipName1 = TN_R1:isShipment() = 1 ? TN_R1:shipmentName() : "Out of stock"
        TN_ShipName2 = TN_R2:isShipment() = 1 ? TN_R2:shipmentName() : "Out of stock"
        TN_ShipName3 = TN_R3:isShipment() = 1 ? TN_R3:shipmentName() : "Out of stock"
        TN_ShipName4 = TN_R4:isShipment() = 1 ? TN_R4:shipmentName() : "Out of stock"
        TN_ShipName5 = TN_R5:isShipment() = 1 ? TN_R5:shipmentName() : "Out of stock"
        TN_ShipName6 = TN_R6:isShipment() = 1 ? TN_R6:shipmentName() : "Out of stock"
        TN_ShipName7 = TN_R7:isShipment() = 1 ? TN_R7:shipmentName() : "Out of stock"
        TN_ShipName8 = TN_R8:isShipment() = 1 ? TN_R8:shipmentName() : "Out of stock"
       
if(TN_ShipName1&TN_ShipName2&TN_ShipName3&TN_ShipName4&TN_ShipName5&TN_ShipName6&TN_ShipName7 == "Out of stock"){timer("TN_Reminder",300000)}
if(clk("TN_Reminder")){
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999),"Reminder: When you place a new shipment in a Ranger Slot, remember to change/update the price!")
    timer("TN_Reminder",5000)
}
   
 
#-:This method might not be the best, but it gets the job done and does not harm the ops:-#
if(inputClk() & TN_Menu == "TN_WeaponMenu"){
   
        TN_ShipName1 = TN_R1:isShipment() == 1 ? TN_R1:shipmentName() : "Out of stock"
        TN_ShipName2 = TN_R2:isShipment() == 1 ? TN_R2:shipmentName() : "Out of stock"
        TN_ShipName3 = TN_R3:isShipment() == 1 ? TN_R3:shipmentName() : "Out of stock"
        TN_ShipName4 = TN_R4:isShipment() == 1 ? TN_R4:shipmentName() : "Out of stock"
        TN_ShipName5 = TN_R5:isShipment() == 1 ? TN_R5:shipmentName() : "Out of stock"
        TN_ShipName6 = TN_R6:isShipment() == 1 ? TN_R6:shipmentName() : "Out of stock"
        TN_ShipName7 = TN_R7:isShipment() == 1 ? TN_R7:shipmentName() : "Out of stock"
        TN_ShipName8 = TN_R8:isShipment() == 1 ? TN_R8:shipmentName() : "Out of stock"
 
    for(TN_Index=49,56){
       
        TN_EGP:egpSetText(49,"$"+TN_Price1)
        TN_EGP:egpSetText(50,"$"+TN_Price2)
        TN_EGP:egpSetText(51,"$"+TN_Price3)
        TN_EGP:egpSetText(52,"$"+TN_Price4)
        TN_EGP:egpSetText(53,"$"+TN_Price5)
        TN_EGP:egpSetText(54,"$"+TN_Price6)
        TN_EGP:egpSetText(55,"$"+TN_Price7)
        TN_EGP:egpSetText(56,"$"+TN_Price8)
        TN_EGP:egpAlign(TN_Index,1,1)
        TN_EGP:egpFont(TN_Index,"coolvetica",20)
    }
   
        TN_EGP:egpSetText(26,"1) "+TN_ShipName1)
        TN_EGP:egpSetText(28,"2) "+TN_ShipName2)
        TN_EGP:egpSetText(30,"3) "+TN_ShipName3)
        TN_EGP:egpSetText(32,"4) "+TN_ShipName4)
        TN_EGP:egpSetText(34,"5) "+TN_ShipName5)
        TN_EGP:egpSetText(36,"6) "+TN_ShipName6)
        TN_EGP:egpSetText(38,"7) "+TN_ShipName7)
        TN_EGP:egpSetText(40,"8) "+TN_ShipName8)
       
  if(TN_ShipName1=="Out of stock"){TN_EGP:egpSetText(49,"$0")}
  if(TN_ShipName2=="Out of stock"){TN_EGP:egpSetText(50,"$0")}
  if(TN_ShipName3=="Out of stock"){TN_EGP:egpSetText(51,"$0")}
  if(TN_ShipName4=="Out of stock"){TN_EGP:egpSetText(52,"$0")}
  if(TN_ShipName5=="Out of stock"){TN_EGP:egpSetText(53,"$0")}
  if(TN_ShipName6=="Out of stock"){TN_EGP:egpSetText(54,"$0")}
  if(TN_ShipName7=="Out of stock"){TN_EGP:egpSetText(55,"$0")}
  if(TN_ShipName8=="Out of stock"){TN_EGP:egpSetText(56,"$0")}
 
}
 
#-:This method might not be the best, but it gets the job done and does not harm the ops:-#
function void tn_UpdateShipmentInfo(){
   
        TN_ShipName1 = TN_R1:isShipment() == 1 ? TN_R1:shipmentName() : "Out of stock"
        TN_ShipName2 = TN_R2:isShipment() == 1 ? TN_R2:shipmentName() : "Out of stock"
        TN_ShipName3 = TN_R3:isShipment() == 1 ? TN_R3:shipmentName() : "Out of stock"
        TN_ShipName4 = TN_R4:isShipment() == 1 ? TN_R4:shipmentName() : "Out of stock"
        TN_ShipName5 = TN_R5:isShipment() == 1 ? TN_R5:shipmentName() : "Out of stock"
        TN_ShipName6 = TN_R6:isShipment() == 1 ? TN_R6:shipmentName() : "Out of stock"
        TN_ShipName7 = TN_R7:isShipment() == 1 ? TN_R7:shipmentName() : "Out of stock"
        TN_ShipName8 = TN_R8:isShipment() == 1 ? TN_R8:shipmentName() : "Out of stock"
   
        TN_EGP:egpSetText(26,"1) "+TN_ShipName1)
        TN_EGP:egpSetText(28,"2) "+TN_ShipName2)
        TN_EGP:egpSetText(30,"3) "+TN_ShipName3)
        TN_EGP:egpSetText(32,"4) "+TN_ShipName4)
        TN_EGP:egpSetText(34,"5) "+TN_ShipName5)
        TN_EGP:egpSetText(36,"6) "+TN_ShipName6)
        TN_EGP:egpSetText(38,"7) "+TN_ShipName7)
        TN_EGP:egpSetText(40,"8) "+TN_ShipName8)
   
        TN_EGP:egpSetText(49,"$"+TN_Price1)
        TN_EGP:egpSetText(50,"$"+TN_Price2)
        TN_EGP:egpSetText(51,"$"+TN_Price3)
        TN_EGP:egpSetText(52,"$"+TN_Price4)
        TN_EGP:egpSetText(53,"$"+TN_Price5)
        TN_EGP:egpSetText(54,"$"+TN_Price6)
        TN_EGP:egpSetText(55,"$"+TN_Price7)
        TN_EGP:egpSetText(56,"$"+TN_Price8)
       
}
 
#-----------------------------------------------#
#:Section 4 - Drawing - Welcome Menu/First Menu:#
#-----------------------------------------------#
 
function wirelink:tn_WelcomeMenu(){
        TN_Menu = "TN_WelcomeMenu"
       
        TN_EGP:egpBox(1,vec2(256,256),vec2(520,520))
        TN_EGP:egpMaterial(1,"gui/gradient_up")
        TN_EGP:egpColor(1,vec(0,51,102))
   
        TN_EGP:egpBox(2,vec2(256,256),vec2(520,520))
        TN_EGP:egpMaterial(2,"gui/gradient_down")
        TN_EGP:egpColor(2,vec(0,76,153))
   
        TN_EGP:egpCircle(3,vec2(1,25),vec2(70,70))
        TN_EGP:egpColor(3,vec(4,23,36))
   
        TN_EGP:egpCircle(4,vec2(499,25),vec2(70,70))
        TN_EGP:egpColor(4,vec(4,23,36))
 
        TN_EGP:egpCircle(5,vec2(499,475),vec2(70,70))
        TN_EGP:egpColor(5,vec(4,23,36))
   
        TN_EGP:egpCircle(6,vec2(1,475),vec2(70,70))
        TN_EGP:egpColor(6,vec(4,23,36))
   
        TN_EGP:egpBox(7,vec2(15,256),vec2(35,450))
        TN_EGP:egpColor(7,vec(4,23,36))
   
        TN_EGP:egpBox(8,vec2(495,256),vec2(35,450))
        TN_EGP:egpColor(8,vec(4,23,36))
   
        TN_EGP:egpBox(9,vec2(256,495),vec2(450,35))
        TN_EGP:egpColor(9,vec(4,23,36))
   
        TN_EGP:egpBox(10,vec2(256,15),vec2(450,35))
        TN_EGP:egpColor(10,vec(4,23,36))
   
        TN_EGP:egpBox(11,vec2(256,18),vec2(485,5))
        TN_EGP:egpColor(11,vec(0,102,51))
   
        TN_EGP:egpBox(12,vec2(256,493),vec2(485,5))
        TN_EGP:egpColor(12,vec(0,102,51))
   
        TN_EGP:egpBox(13,vec2(496,256),vec2(5,478))
        TN_EGP:egpColor(13,vec(0,102,51))
       
        TN_EGP:egpBox(14,vec2(16,256),vec2(5,478))
        TN_EGP:egpColor(14,vec(0,102,51))
       
        TN_EGP:egpRoundedBox(15,vec2(256,256),vec2(365,300))
        TN_EGP:egpColor(15,vec(255,0,0))
        TN_EGP:egpAlign(15,1,1)
        TN_EGP:egpAlpha(15,165)
   
        TN_EGP:egpText(16,"Press anywhere",vec2(256,150))
        TN_EGP:egpFont(16,"coolvetica",50)
        TN_EGP:egpAlign(16,1,1)
       
        TN_EGP:egpText(17,"in this red box",vec2(256,200))
        TN_EGP:egpFont(17,"coolvetica",50)
        TN_EGP:egpAlign(17,1,1)
       
        TN_EGP:egpText(18,"to begin shopping!",vec2(256,250))
        TN_EGP:egpFont(18,"coolvetica",50)
        TN_EGP:egpAlign(18,1,1)
       
        TN_EGP:egpBox(19,vec2(256,340),vec2(240,130))
        TN_EGP:egpMaterial(19,"weapons/weapon_mad_admin")
       
        TN_EGP:egpRoundedBox(20,vec2(256,35),vec2(450,120))
        TN_EGP:egpColor(20,vec(4,23,36))
       
        TN_EGP:egpRoundedBox(21,vec2(256,35),vec2(444,114))
        TN_EGP:egpColor(21,vec(0,102,51))
       
        TN_EGP:egpText(22,"[Tron.Net] | TN.Shop |",vec2(256,35))
        TN_EGP:egpFont(22,"coolvetica",43)
        TN_EGP:egpAlign(22,1,1)
       
        TN_EGP:egpRoundedBox(23,vec2(256,445),vec2(200,50))
        TN_EGP:egpColor(23,vec(255,0,0))
        TN_EGP:egpAlign(23,1,1)
        TN_EGP:egpAlpha(23,165)
       
        TN_EGP:egpText(24,"Credits",vec2(256,445))
        TN_EGP:egpFont(24,"coolvetica",50)
        TN_EGP:egpAlign(24,1,1)
}
 
if(first()){TN_EGP:tn_WelcomeMenu()} #This shall just make it so that the code starts off with the Welcome Menu#
 
#-----------------------------------#
#:Section 5 - Drawing - Credit Menu:#
#-----------------------------------#
 
function wirelink:tn_CreditMenu(){
    TN_Menu = "TN_CreditMenu"
        TN_EGP:egpBox(1,vec2(256,256),vec2(520,520))
        TN_EGP:egpMaterial(1,"gui/gradient_up")
        TN_EGP:egpColor(1,vec(0,51,102))
   
        TN_EGP:egpBox(2,vec2(256,256),vec2(520,520))
        TN_EGP:egpMaterial(2,"gui/gradient_down")
        TN_EGP:egpColor(2,vec(0,76,153))
   
        TN_EGP:egpCircle(3,vec2(1,25),vec2(70,70))
        TN_EGP:egpColor(3,vec(4,23,36))
   
        TN_EGP:egpCircle(4,vec2(499,25),vec2(70,70))
        TN_EGP:egpColor(4,vec(4,23,36))
 
        TN_EGP:egpCircle(5,vec2(499,475),vec2(70,70))
        TN_EGP:egpColor(5,vec(4,23,36))
   
        TN_EGP:egpCircle(6,vec2(1,475),vec2(70,70))
        TN_EGP:egpColor(6,vec(4,23,36))
   
        TN_EGP:egpBox(7,vec2(15,256),vec2(35,450))
        TN_EGP:egpColor(7,vec(4,23,36))
   
        TN_EGP:egpBox(8,vec2(495,256),vec2(35,450))
        TN_EGP:egpColor(8,vec(4,23,36))
   
        TN_EGP:egpBox(9,vec2(256,495),vec2(450,35))
        TN_EGP:egpColor(9,vec(4,23,36))
   
        TN_EGP:egpBox(10,vec2(256,15),vec2(450,35))
        TN_EGP:egpColor(10,vec(4,23,36))
   
        TN_EGP:egpBox(11,vec2(256,18),vec2(485,5))
        TN_EGP:egpColor(11,vec(0,102,51))
   
        TN_EGP:egpBox(12,vec2(256,493),vec2(485,5))
        TN_EGP:egpColor(12,vec(0,102,51))
   
        TN_EGP:egpBox(13,vec2(496,256),vec2(5,478))
        TN_EGP:egpColor(13,vec(0,102,51))
       
        TN_EGP:egpBox(14,vec2(16,256),vec2(5,478))
        TN_EGP:egpColor(14,vec(0,102,51))
       
        TN_EGP:egpRoundedBox(15,vec2(256,256),vec2(365,60))
        TN_EGP:egpColor(15,vec(255,0,0))
        TN_EGP:egpAlign(15,1,1)
        TN_EGP:egpAlpha(15,165)
       
        TN_EGP:egpText(16,"Thanks to:",vec2(256,120))
        TN_EGP:egpFont(16,"coolvetica",50)
        TN_EGP:egpAlign(16,1,1)
             
        TN_EGP:egpText(17,"Crypto / Duke Nuken",vec2(256,256))
        TN_EGP:egpFont(17,"coolvetica",40)
        TN_EGP:egpAlign(17,1,1)
       
        TN_EGP:egpBox(18,vec2(100,450),vec2(50,50))
        TN_EGP:egpMaterial(18,"vgui/notices/error.vmt")
       
        TN_EGP:egpText(19,"Exit",vec2(160,450))
        TN_EGP:egpFont(19,"coolvetica",35)
        TN_EGP:egpAlign(19,1,1)
       
        TN_EGP:egpRoundedBox(20,vec2(256,35),vec2(450,120))
        TN_EGP:egpColor(20,vec(4,23,36))
       
        TN_EGP:egpRoundedBox(21,vec2(256,35),vec2(444,114))
        TN_EGP:egpColor(21,vec(0,102,51))
       
        TN_EGP:egpText(22,"[Tron.Net] | TN.Shop |",vec2(256,35))
        TN_EGP:egpFont(22,"coolvetica",43)
        TN_EGP:egpAlign(22,1,1)
       
        TN_EGP:egpRoundedBox(23,vec2(256,340),vec2(365,60))
        TN_EGP:egpColor(23,vec(255,0,0))
        TN_EGP:egpAlign(23,1,1)
        TN_EGP:egpAlpha(23,165)
       
        TN_EGP:egpText(24,"Made by skytron",vec2(256,340))
        TN_EGP:egpFont(24,"coolvetica",40)
        TN_EGP:egpAlign(24,1,1)
}
}
 
#-----------------------------------------------#
#:Section 6 - Drawing - Weapon Menu/Second Menu:#
#-----------------------------------------------#    
     
function wirelink:tn_WeaponMenu(){
        TN_Menu = "TN_WeaponMenu"
       
        TN_ShipName1 = TN_R1:isShipment() == 1 ? TN_R1:shipmentName() : "Out of stock"
        TN_ShipName2 = TN_R2:isShipment() == 1 ? TN_R2:shipmentName() : "Out of stock"
        TN_ShipName3 = TN_R3:isShipment() == 1 ? TN_R3:shipmentName() : "Out of stock"
        TN_ShipName4 = TN_R4:isShipment() == 1 ? TN_R4:shipmentName() : "Out of stock"
        TN_ShipName5 = TN_R5:isShipment() == 1 ? TN_R5:shipmentName() : "Out of stock"
        TN_ShipName6 = TN_R6:isShipment() == 1 ? TN_R6:shipmentName() : "Out of stock"
        TN_ShipName7 = TN_R7:isShipment() == 1 ? TN_R7:shipmentName() : "Out of stock"
        TN_ShipName8 = TN_R8:isShipment() == 1 ? TN_R8:shipmentName() : "Out of stock"
       
        TN_EGP:egpBox(1,vec2(256,256),vec2(520,520))
        TN_EGP:egpMaterial(1,"gui/gradient_up")
        TN_EGP:egpColor(1,vec(0,51,102))
   
        TN_EGP:egpBox(2,vec2(256,256),vec2(520,520))
        TN_EGP:egpMaterial(2,"gui/gradient_down")
        TN_EGP:egpColor(2,vec(0,76,153))
   
        TN_EGP:egpCircle(3,vec2(1,25),vec2(70,70))
        TN_EGP:egpColor(3,vec(4,23,36))
   
        TN_EGP:egpCircle(4,vec2(499,25),vec2(70,70))
        TN_EGP:egpColor(4,vec(4,23,36))
   
        TN_EGP:egpCircle(5,vec2(499,475),vec2(70,70))
        TN_EGP:egpColor(5,vec(4,23,36))
   
        TN_EGP:egpCircle(6,vec2(1,475),vec2(70,70))
        TN_EGP:egpColor(6,vec(4,23,36))
   
        TN_EGP:egpBox(7,vec2(15,256),vec2(35,450))
        TN_EGP:egpColor(7,vec(4,23,36))
   
        TN_EGP:egpBox(8,vec2(495,256),vec2(35,450))
        TN_EGP:egpColor(8,vec(4,23,36))
   
        TN_EGP:egpBox(9,vec2(256,495),vec2(450,35))
        TN_EGP:egpColor(9,vec(4,23,36))
   
        TN_EGP:egpBox(10,vec2(256,15),vec2(450,35))
        TN_EGP:egpColor(10,vec(4,23,36))
   
        TN_EGP:egpBox(11,vec2(256,18),vec2(485,5))
        TN_EGP:egpColor(11,vec(0,102,51))
   
        TN_EGP:egpBox(12,vec2(256,493),vec2(485,5))
        TN_EGP:egpColor(12,vec(0,102,51))
   
        TN_EGP:egpBox(13,vec2(496,256),vec2(5,478))
        TN_EGP:egpColor(13,vec(0,102,51))
       
        TN_EGP:egpBox(14,vec2(16,256),vec2(5,478))
        TN_EGP:egpColor(14,vec(0,102,51))
       
        TN_EGP:egpRoundedBox(15,vec2(256,35),vec2(450,120))
        TN_EGP:egpColor(15,vec(4,23,36))
       
        TN_EGP:egpRoundedBox(16,vec2(256,35),vec2(444,114))
        TN_EGP:egpColor(16,vec(0,102,51))
       
        TN_EGP:egpText(17,"[Tron.Net] | TN.Shop |",vec2(256,35))
        TN_EGP:egpFont(17,"coolvetica",43)
        TN_EGP:egpAlign(17,1,1)
       
        TN_EGP:egpBox(18,vec2(100,450),vec2(50,50))
        TN_EGP:egpMaterial(18,"vgui/notices/error.vmt")
       
        TN_EGP:egpText(19,"Exit",vec2(160,450))
        TN_EGP:egpFont(19,"coolvetica",35)
        TN_EGP:egpAlign(19,1,1)
       
        TN_EGP:egpRoundedBox(20,vec2(256,256),vec2(410,300))
        TN_EGP:egpColor(20,vec(4,23,36))
        TN_EGP:egpAlign(20,1,1)
   
        TN_EGP:egpRoundedBox(21,vec2(256,256),vec2(400,290))
        TN_EGP:egpColor(21,vec(0,102,51))
        TN_EGP:egpAlign(21,1,1)
   
        TN_EGP:egpBox(22,vec2(360,256),vec2(5,300))
        TN_EGP:egpColor(22,vec(4,23,36))
   
        TN_EGP:egpText(23,"Price:",vec2(410,130))
        TN_EGP:egpColor(23,vec(999,999,999))
        TN_EGP:egpFont(23,"coolvetica",38)
        TN_EGP:egpAlign(23,1,1)
   
        TN_EGP:egpText(24,"Weapons:",vec2(150,130))
        TN_EGP:egpColor(24,vec(999,999,999))
        TN_EGP:egpFont(24,"coolvetica",38)
        TN_EGP:egpAlign(24,1,1)
       
        TN_EGP:egpBox(25,vec2(155,160),vec2(170,20))    
        TN_EGP:egpColor(25,vec4(0,153,153,121))
        TN_EGP:egpAlign(25,1,1)
        TN_EGP:egpText(26,"1) "+TN_ShipName1,vec2(75,152))
        TN_EGP:egpFont(26,"coolvetica",20)
   
        TN_EGP:egpBox(27,vec2(155,190),vec2(170,20))    
        TN_EGP:egpColor(27,vec4(0,153,153,121))
        TN_EGP:egpAlign(27,1,1)
        TN_EGP:egpText(28,"2) "+TN_ShipName2,vec2(75,182))
        TN_EGP:egpFont(28,"coolvetica",20)
 
        TN_EGP:egpBox(29,vec2(155,220),vec2(170,20))    
        TN_EGP:egpColor(29,vec4(0,153,153,121))
        TN_EGP:egpAlign(29,1,1)
        TN_EGP:egpText(30,"3) "+TN_ShipName3,vec2(75,212))
        TN_EGP:egpFont(30,"coolvetica",20)
   
        TN_EGP:egpBox(31,vec2(155,250),vec2(170,20))    
        TN_EGP:egpColor(31,vec4(0,153,153,121))
        TN_EGP:egpAlign(31,1,1)
        TN_EGP:egpText(32,"4) "+TN_ShipName4,vec2(75,242))
        TN_EGP:egpFont(32,"coolvetica",20)
   
        TN_EGP:egpBox(33,vec2(155,280),vec2(170,20))    
        TN_EGP:egpColor(33,vec4(0,153,153,121))
        TN_EGP:egpAlign(33,1,1)
        TN_EGP:egpText(34,"5) "+TN_ShipName5,vec2(75,272))
        TN_EGP:egpFont(34,"coolvetica",20)
   
        TN_EGP:egpBox(35,vec2(155,310),vec2(170,20))    
        TN_EGP:egpColor(35,vec4(0,153,153,121))
        TN_EGP:egpAlign(35,1,1)
        TN_EGP:egpText(36,"6) "+TN_ShipName6,vec2(75,302))
        TN_EGP:egpFont(36,"coolvetica",20)
   
        TN_EGP:egpBox(37,vec2(155,340),vec2(170,20))    
        TN_EGP:egpColor(37,vec4(0,153,153,121))
        TN_EGP:egpAlign(37,1,1)
        TN_EGP:egpText(38,"7) "+TN_ShipName7,vec2(75,332))
        TN_EGP:egpFont(38,"coolvetica",20)
       
        TN_EGP:egpBox(39,vec2(155,370),vec2(170,20))    
        TN_EGP:egpColor(39,vec4(0,153,153,121))
        TN_EGP:egpAlign(39,1,1)
        TN_EGP:egpText(40,"8) "+TN_ShipName8,vec2(75,362))
        TN_EGP:egpFont(40,"coolvetica",20)
       
        TN_EGP:egpBox(41,vec2(409,160),vec2(80,20))
        TN_EGP:egpColor(41,vec4(0,153,153,121))
        TN_EGP:egpAlign(41,1,1)
   
        TN_EGP:egpBox(42,vec2(409,190),vec2(80,20))
        TN_EGP:egpColor(42,vec4(0,153,153,121))
        TN_EGP:egpAlign(42,1,1)
   
        TN_EGP:egpBox(43,vec2(409,220),vec2(80,20))
        TN_EGP:egpColor(43,vec4(0,153,153,121))
        TN_EGP:egpAlign(43,1,1)
   
        TN_EGP:egpBox(44,vec2(409,250),vec2(80,20))
        TN_EGP:egpColor(44,vec4(0,153,153,121))
        TN_EGP:egpAlign(44,1,1)
   
        TN_EGP:egpBox(45,vec2(409,280),vec2(80,20))
        TN_EGP:egpColor(45,vec4(0,153,153,121))
        TN_EGP:egpAlign(45,1,1)
   
        TN_EGP:egpBox(46,vec2(409,310),vec2(80,20))
        TN_EGP:egpColor(46,vec4(0,153,153,121))
        TN_EGP:egpAlign(46,1,1)
   
        TN_EGP:egpBox(47,vec2(409,340),vec2(80,20))
        TN_EGP:egpColor(47,vec4(0,153,153,121))
        TN_EGP:egpAlign(47,1,1)
       
        TN_EGP:egpBox(48,vec2(409,370),vec2(80,20))
        TN_EGP:egpColor(48,vec4(0,153,153,121))
        TN_EGP:egpAlign(48,1,1)
       
        TN_EGP:egpBox(57,vec2(256,256),vec2(5,300))
        TN_EGP:egpColor(57,vec(4,23,36))
       
        TN_EGP:egpBox(58,vec2(315,170),vec2(120,100))
        TN_EGP:egpMaterial(58,"weapons/weapon_mad_mp5")
        TN_EGP:egpAngle(58,45)
        TN_EGP:egpAlign(58,1,1)
       
        TN_EGP:egpBox(59,vec2(312,250),vec2(80,110))
        TN_EGP:egpMaterial(59,"weapons/weapon_mad_ak47")
        TN_EGP:egpAngle(59,145)
        TN_EGP:egpAlign(59,1,1)
       
        TN_EGP:egpBox(60,vec2(312,370),vec2(120,100))
        TN_EGP:egpMaterial(60,"weapons/weapon_mad_galil")
        TN_EGP:egpAngle(60,45)
        TN_EGP:egpAlign(60,1,1)
   
    for(TN_Index=49,56){
        TN_EGP:egpText(49,"$"+TN_Price1,vec2(408,161))
        TN_EGP:egpText(50,"$"+TN_Price2,vec2(408,191))
        TN_EGP:egpText(51,"$"+TN_Price3,vec2(408,221))
        TN_EGP:egpText(52,"$"+TN_Price4,vec2(408,251))
        TN_EGP:egpText(53,"$"+TN_Price5,vec2(408,281))
        TN_EGP:egpText(54,"$"+TN_Price6,vec2(408,311))
        TN_EGP:egpText(55,"$"+TN_Price7,vec2(408,341))
        TN_EGP:egpText(56,"$"+TN_Price8,vec2(408,371))
        TN_EGP:egpAlign(TN_Index,1,1)
        TN_EGP:egpFont(TN_Index,"coolvetica",20)
    }
}
 
#-----------------------------------------#
#:Section 7 - Drawing - Insert Money Menu:#
#-----------------------------------------#
 
function wirelink:tn_InsertMoneyMenu(){
        TN_EGP:egpRoundedBox(100,vec2(256,256),vec2(400,290))
        TN_EGP:egpColor(100,vec(0,153,153))
        TN_EGP:egpAlign(100,1,1)
        TN_EGP:egpAlpha(100,120)
   
        TN_EGP:egpText(101,"Please Insert",vec2(256,200))
        TN_EGP:egpColor(101,vec(255,0,0))
        TN_EGP:egpFont(101,"coolvetica",50)
        TN_EGP:egpAlign(101,1,1)
       
        TN_EGP:egpText(102,"The Correct",vec2(256,250))
        TN_EGP:egpColor(102,vec(255,0,0))
        TN_EGP:egpFont(102,"coolvetica",50)
        TN_EGP:egpAlign(102,1,1)
       
        TN_EGP:egpText(103,"Amount of Money!",vec2(256,300))
        TN_EGP:egpColor(103,vec(255,0,0))
        TN_EGP:egpFont(103,"coolvetica",50)
        TN_EGP:egpAlign(103,1,1)
}
 
#----------------------------------------------#
#:Section 8 - Drawing - Enjoy Your Weapon Menu:#
#----------------------------------------------#
 
function wirelink:tn_EnjoyYourWeaponMenu(){
        TN_EGP:egpRoundedBox(100,vec2(256,256),vec2(400,290))
        TN_EGP:egpColor(100,vec(0,153,153))
        TN_EGP:egpAlign(100,1,1)
        TN_EGP:egpAlpha(100,120)
   
        TN_EGP:egpText(101,"Enjoy Your",vec2(256,200))
        TN_EGP:egpColor(101,vec(255,0,0))
        TN_EGP:egpFont(101,"coolvetica",50)
        TN_EGP:egpAlign(101,1,1)
       
        TN_EGP:egpText(102,"Weapon!",vec2(256,250))
        TN_EGP:egpColor(102,vec(255,0,0))
        TN_EGP:egpFont(102,"coolvetica",50)
        TN_EGP:egpAlign(102,1,1)
}
 
#--------------------------------#
#:Section 9 - Cursor Information:#
#--------------------------------#
 
if(first()){
function string wirelink:tn_cursorInRange(TN_Cursor:entity,TN_ID:normal){
        TN_TopLeft=(TN_EGP:egpPos(TN_ID)-(TN_EGP:egpSize(TN_ID)/2))
        TN_BottomRight=(TN_EGP:egpPos(TN_ID)+(TN_EGP:egpSize(TN_ID)/2))
        if(inrange(TN_EGP:egpCursor(TN_Cursor),TN_TopLeft,TN_BottomRight)){
          return "true"
    }else{
          return "false"  
    }
}
}
 
########################################################################################
#-:Weapon Menu:-#
########################################################################################
if(TN_Menu == "TN_WelcomeMenu"){
    if(TN_EGP:tn_cursorInRange(TN_User,15) =="true" & TN_User:keyUse()&&!TN_CSpam1){
        TN_EGP:egpClear()
        TN_EGP:tn_WeaponMenu()
        TN_CSpam1 = 1
        TN_FadeDoor=0
        soundPlay(2,0,"npc/scanner/scanner_scan4.wav")
        timer("TN_CSpam1",3000)
    }
}
########################################################################################
#-:Exit Menu:-#
########################################################################################
if(TN_Menu == "TN_WeaponMenu"){
    if(TN_EGP:tn_cursorInRange(TN_User,18)=="true"&&TN_User:keyUse()&&!TN_CSpam2){
        TN_EGP:egpClear()
        TN_EGP:tn_WelcomeMenu()
        TN_CSpam2 = 1
        TN_FadeDoor = 1
        soundPlay(0,0,"npc/scanner/scanner_scan4.wav")
        timer("TN_CSpam2",3000)
    }
}
 
if(TN_Menu == "TN_CreditMenu"){
    if(TN_EGP:tn_cursorInRange(TN_User,18)=="true"&&TN_User:keyUse()&&!TN_CSpam2){
        TN_EGP:egpClear()
        TN_EGP:tn_WelcomeMenu()
        TN_CSpam2 = 1
        TN_FadeDoor = 1
        soundPlay(0,0,"npc/scanner/scanner_scan4.wav")
        timer("TN_CSpam2",3000)
    }
}
########################################################################################
#-:Credit Menu:-#
########################################################################################
if(TN_Menu == "TN_WelcomeMenu"){
    if(TN_EGP:tn_cursorInRange(TN_User,23)=="true"&&TN_User:keyUse()&&!TN_CSpam11){
        TN_EGP:egpClear()
        TN_EGP:tn_CreditMenu()
        TN_CSpam = 1
        TN_FadeDoor = 1
        soundPlay(0,0,"npc/scanner/scanner_scan4.wav")
        timer("TN_CSpam11",3000)
    }
}
########################################################################################
#-:All here involves the spawning and purchasing of the weapon:-#
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,25)=="true"&&TN_User:keyUse()&&!TN_CSpam3){
    if(TN_StoredAmount<TN_Price1){
        TN_CSpam3 = 1
        TN_EGP:tn_InsertMoneyMenu()
        timer("TN_StartSound9",500)
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam3",3000)
}
########################################################################################
if(TN_StoredAmount>=TN_Price1){
    if(TN_R1:isShipment()){
        TN_U1 = 1
        TN_CSpam3 = 1
        TN_SpawnAmount = TN_Price1
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_CSpam3",3000)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
        timer("TN_StartSound1",500)
    }
}
}
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,27)=="true"&&TN_User:keyUse()&&!TN_CSpam4){
     if(TN_StoredAmount<TN_Price2){
        TN_CSpam4 = 1
        TN_EGP:tn_InsertMoneyMenu()
        timer("TN_StartSound10",500)
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam4",3000)
}
    if(TN_StoredAmount>=TN_Price2){
        if(TN_R2:isShipment()){
        TN_U2 = 1
        TN_CSpam4 = 1
        TN_SpawnAmount = TN_Price2
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_StartSound2",500)
        timer("TN_CSpam4",3000)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
    }
}
}
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,29)=="true"&&TN_User:keyUse()&&!TN_CSpam5){
     if(TN_StoredAmount<TN_Price3){
        TN_CSpam5 = 1
        TN_EGP:tn_InsertMoneyMenu()
        timer("TN_StartSound11",500)
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam5",3000)
}
    if(TN_StoredAmount>=TN_Price3){
        if(TN_R3:isShipment()){
        TN_U3 = 1
        TN_CSpam5 = 1
        TN_SpawnAmount = TN_Price3
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_CSpam5",3000)
        timer("TN_StartSound3",500)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
    }
}
}
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,31)=="true"&&TN_User:keyUse()&&!TN_CSpam6){
     if(TN_StoredAmount<TN_Price4){
        TN_CSpam6 = 1
        timer("TN_StartSound12",500)
        TN_EGP:tn_InsertMoneyMenu()
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam6",3000)
}
    if(TN_StoredAmount>=TN_Price4){
        if(TN_R4:isShipment()){
        TN_U4 = 1
        TN_CSpam6 = 1
        TN_SpawnAmount = TN_Price4
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_CSpam6",3000)
        timer("TN_StartSound4",500)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
    }
}
}
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,33)=="true"&&TN_User:keyUse()&&!TN_CSpam7){
     if(TN_StoredAmount<TN_Price5){
        TN_CSpam7 = 1
        TN_EGP:tn_InsertMoneyMenu()
        timer("TN_StartSound13",500)
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam7",3000)
}
    if(TN_StoredAmount>=TN_Price5){
        if(TN_R5:isShipment()){
        TN_U5 = 1
        TN_CSpam7 = 1
        TN_SpawnAmount = TN_Price5
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_CSpam7",3000)
        timer("TN_StartSound5",500)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
    }
}
}
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,35)=="true"&&TN_User:keyUse()&&!TN_CSpam8){
     if(TN_StoredAmount<TN_Price6){
        TN_CSpam8 = 1
        TN_EGP:tn_InsertMoneyMenu()
        timer("TN_StartSound14",500)
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam8",3000)
}
    if(TN_StoredAmount>=TN_Price6){
        if(TN_R6:isShipment()){
        TN_U6 = 1
        TN_CSpam8 = 1
        TN_SpawnAmount = TN_Price6
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_CSpam8",3000)
        timer("TN_StartSound6",500)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
    }
}
}
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,37)=="true"&&TN_User:keyUse()&&!TN_CSpam9){
     if(TN_StoredAmount<TN_Price7){
        TN_CSpam9 = 1
        TN_EGP:tn_InsertMoneyMenu()
        timer("TN_StartSound15",500)
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam9",3000)
}
    if(TN_StoredAmount>=TN_Price7){
        if(TN_R7:isShipment()){
        TN_U7 = 1
        TN_CSpam9 = 1
        TN_SpawnAmount = TN_Price7
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_CSpam9",3000)
        timer("TN_StartSound7",500)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
    }
}
}
########################################################################################
if(TN_EGP:tn_cursorInRange(TN_User,39)=="true"&&TN_User:keyUse()&&!TN_CSpam10){
     if(TN_StoredAmount<TN_Price8){
        TN_TAS_CSpam10 = 1
        timer("StartSound16",500)
        TN_EGP:tn_InsertMoneyMenu()
        timer("Clear_TN_insertMoneyMenu",3000)
        timer("TN_CSpam10",3000)
}
    if(TN_StoredAmount>=TN_Price8){
        if(TN_R8:isShipment()){
        TN_U8 = 1
        TN_CSpam10 = 1
        TN_SpawnAmount = TN_Price8
        TN_EGP:tn_EnjoyYourWeaponMenu()
        timer("TN_ResetUsers",1000)
        timer("TN_ResetMoneyPot",2000)
        timer("TN_CSpam10",3000)
        timer("TN_StartSound8",500)
        timer("Clear_TN_EnjoyYourWeaponMenu",3000)
    }
}
}
TN_EGP:egpBox(999,vec2(256,256),vec2(50,50))
TN_EGP:egpMaterial(999,"vgui/cursors/hand")
TN_EGP:egpParentToCursor(999)
########################################################################################
 
#----------------------------#
#:Section 10 - Player Logout:#
#----------------------------#
findInSphere(TN_EGP:entity():pos(),TN_Distance)
findIncludeClass("player")
TN_Player = findResult(1)
 
if(TN_Menu == "TN_WeaponMenu"){
if(TN_Player:isAlive()){
   
        TN_EGP:egpRemove(104)
        TN_EGP:egpRemove(105)
        TN_EGP:egpRemove(106)
        TN_EGP:egpRemove(107)
       
        stoptimer("TN_Logout")
}else{
 
        TN_EGP:egpRoundedBox(104,vec2(256,256),vec2(400,290))
        TN_EGP:egpColor(104,vec(0,153,153))
        TN_EGP:egpAlign(104,1,1)
        TN_EGP:egpAlpha(104,120)
   
        TN_EGP:egpText(105,"Come closer",vec2(256,200))
        TN_EGP:egpColor(105,vec(255,0,0))
        TN_EGP:egpFont(105,"coolvetica",50)
        TN_EGP:egpAlign(105,1,1)
       
        TN_EGP:egpText(106,"To the screen",vec2(256,250))
        TN_EGP:egpColor(106,vec(255,0,0))
        TN_EGP:egpFont(106,"coolvetica",50)
        TN_EGP:egpAlign(106,1,1)
       
        TN_EGP:egpText(107,"or be logged out..",vec2(256,300))
        TN_EGP:egpColor(107,vec(255,0,0))
        TN_EGP:egpFont(107,"coolvetica",50)
        TN_EGP:egpAlign(107,1,1)
       
        timer("TN_Logout",5000)
    }
}
 
#---------------------#
#:Section 11 - Timers:#
#---------------------#
 
if(clk("TN_ResetUsers")){
    TN_U1 = 0
    TN_U2 = 0
    TN_U3 = 0
    TN_U4 = 0
    TN_U5 = 0
    TN_U6 = 0
    TN_U7 = 0
    TN_U8 = 0
}elseif(clk("TN_ResetMoneyPot")){
    TN_SpawnAmount = 0
}
 
if(clk("Clear_TN_EnjoyYourWeaponMenu")){TN_EGP:egpRemove(100) TN_EGP:egpRemove(101) TN_EGP:egpRemove(102)}
if(clk("Clear_TN_insertMoneyMenu")){TN_EGP:egpRemove(100) TN_EGP:egpRemove(101) TN_EGP:egpRemove(102) TN_EGP:egpRemove(103)}
 
if(clk("TN_CSpam1")){TN_CSpam1=0}
if(clk("TN_CSpam2")){TN_CSpam2=0}
if(clk("TN_CSpam3")){TN_CSpam3=0}
if(clk("TN_CSpam4")){TN_CSpam4=0}
if(clk("TN_CSpam5")){TN_CSpam5=0}
if(clk("TN_CSpam6")){TN_CSpam6=0}
if(clk("TN_CSpam7")){TN_CSpam7=0}
if(clk("TN_CSpam8")){TN_CSpam8=0}
if(clk("TN_CSpam9")){TN_CSpam9=0}
if(clk("TN_CSpam10")){TN_CSpam10=0}
if(clk("TN_CSpam11")){TN_CSpam11=0}
 
if(clk("TN_StartSound1")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound2")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound3")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound4")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound5")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound6")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound7")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound8")){soundPlay(2,0.93,"npc/scanner/scanner_siren1.wav")}
if(clk("TN_StartSound9")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
if(clk("TN_StartSound10")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
if(clk("TN_StartSound11")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
if(clk("TN_StartSound12")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
if(clk("TN_StartSound13")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
if(clk("TN_StartSound14")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
if(clk("TN_StartSound15")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
if(clk("TN_StartSound16")){soundPlay(2,0.875,"npc/scanner/combat_scan5.wav")}
 
if(clk("TN_Logout")){
    TN_EGP:egpClear()  
    TN_EGP:tn_WelcomeMenu()
    TN_EGP:egpRemove(104)
    TN_EGP:egpRemove(105)
    TN_EGP:egpRemove(106)
    TN_EGP:egpRemove(107)
    TN_FadeDoor=1
}
 
#----------------------------#
#:Section 12 - Chat Commands:#
#----------------------------#
 
runOnChat(1)
if(chatClk(owner())){
TN_A = owner():lastSaid():explode(" ")
if(TN_A[1,string]=="!price"){
    hideChat(1)
        if(TN_A[2,string]:toNumber() == 1){
            TN_Price1=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 1 has been set to: ",vec(255,0,0),"$"+TN_Price1)
        }
        if(TN_A[2,string]:toNumber() == 2){
            TN_Price2=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 2 has been set to: ",vec(255,0,0),"$"+TN_Price2)
        }
        if(TN_A[2,string]:toNumber() == 3){
            TN_Price3=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 3 has been set to: ",vec(255,0,0),"$"+TN_Price3)
        }
        if(TN_A[2,string]:toNumber() == 4){
            TN_Price4=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 4 has been set to: ",vec(255,0,0),"$"+TN_Price4)
        }
        if(TN_A[2,string]:toNumber() == 5){
            TN_Price5=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 5 has been set to: ",vec(255,0,0),"$"+TN_Price5)
        }
        if(TN_A[2,string]:toNumber() == 6){
            TN_Price6=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 6 has been set to: ",vec(255,0,0),"$"+TN_Price6)
        }
        if(TN_A[2,string]:toNumber() == 7){
            TN_Price7=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 7 has been set to: ",vec(255,0,0),"$"+TN_Price7)
        }
        if(TN_A[2,string]:toNumber() == 8){
            TN_Price8=TN_A[3,string]:toNumber()
            printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Price 8 has been set to: ",vec(255,0,0),"$"+TN_Price8)
        }
       
        tn_UpdateShipmentInfo()
}
 
if(TN_A[1,string]=="!distance"){
    hideChat(1)
    TN_Distance=TN_A[2,string]:toNumber()
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," Logout distance has been set to: "+TN_Distance)
}
 
if(TN_A[1,string]=="!commands"){
    hideChat(1)
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(999,999,999)," List of ",vec(0,255,0),"valid",vec(999,999,999)," commands")
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(255,0,0)," !price",vec(255,128,0)," <number> <amount>",vec(999,999,999)," - This sets the price.")
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(255,0,0)," !distance",vec(255,128,0)," <number>",vec(999,999,999)," - This sets the logout distance.")
    printColor(vec(0,0,0),"[",vec(255,128,0),"TN.Shop",vec(0,0,0),"]",vec(255,0,0)," !commands",vec(999,999,999)," - This shows a list of valid commands.")
       
}
}
