@name QuickShop
@inputs 
@outputs 
@persist Me:entity Guns:table
@trigger 

if (first()) {
    runOnChat(1)
    
    Me = findPlayerByName("Divalent")
    
    Guns = table(
        "ak47"="'fas2_ak47'",
        "ak74"="'fas2_ak74'",
        "dv2"="'fas2_dv2'",
        "famas"="'fas2_famas'",
        "g36c"="'fas2_g36c'",
        "g3a3"="'fas2_g3'",
        "glock"="'fas2_glock20'",
        "deagle"="'fas2_deagle'",
        "uzi"="'fas2_uzi'",
        "m14"="'fas2_m14'",
        "m1911"="'fas2_m1911'",
        "m21"="'fas2_m21'",
        "m24"="'fas2_m24'",
        "m3"="'fas2_m3s90'",
        "m4a1"="'fas2_m4a1'",
        "m82"="'fas2_m82'",
        "machete"="'fas2_machete'",
        "mp5a5"="'fas2_mp5a5'",
        "mp5k"="'fas2_mp5k'",
        "mp5ad6"="'fas2_mp5sd6'",
        "ots33"="'fas2_ots33'",
        "p226"="'fas2_p226'",
        "bizon"="'fas2_pp19'",
        "ragingbull"="'fas2_ragingbull'",
        "rpk"="'fas2_rpk'",
        "rk95"="'fas2_rk95'",
        "sg550"="'fas2_sg550'",
        "sg552"="'fas2_sg552'",
        "sks"="'fas2_sks",
        "sr25"="'fas2_sr25'"
    )
}

if (chatClk(Me)) {
    LS = Me:lastSaid():lower()
    
    if(Guns:exists(LS)){
        hideChat(1)
        
        luaCheat("
            Entity(" + Me:id() + "):Give(" + Guns[LS,string] + ")
        ")
    }
    elseif (LS == "!list") {
        hideChat(1)
        
        luaCheat("
            ply = Entity( " + Me:id() + " )
            ply:PrintMessage( HUD_PRINTTALK, 'Check console for the list of guns.' )
            ply:PrintMessage( HUD_PRINTCONSOLE, '- - - - - - - - - - - -' )
            ply:PrintMessage( HUD_PRINTCONSOLE, '|    List of guns.    |' )
            ply:PrintMessage( HUD_PRINTCONSOLE, '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' )
            ply:PrintMessage( HUD_PRINTCONSOLE, '| ak47, ak74, dv2, famas, g36c, g3a3, glock, deagle, uzi, m14, m1911, m21, m24, m3, m4a1, m82, machete, mp5a5 |' )
            ply:PrintMessage( HUD_PRINTCONSOLE, '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' )
        ")
    }
}
