@name TF2 Dispenser
@inputs 
@outputs 
@persist W:array
@trigger 
runOnChat(1)
Chat=lastSaid()
Who=lastSpoke()
Brk=" "
Com="/tf"


if(chatClk()&Chat:find(Com)){
    if(Chat==Com){
        for(C=1,W:count()){
            Who:chatPrint(toString(C)+" = "+W[C,string])
        }
        Who:chatPrint("type "+Com+" then '"+Brk+"' (space) then a number to receive weapon, (without the quotes.)")
    }
    if(Chat:find(Brk)){
        E=W[Chat:explode(Brk)[2,string]:toNumber(),string]
        entitySpawn(E,Who:pos(),0)     
    }
}



if(first()){
    Pl=players()
    for(C=1,Pl:count()){
        Pl[C,entity]:chatPrint("Type "+Com+" to see TF2 item dispenser menu.")
    }
    W=array()
    W:pushString("ambassador")
    W:pushString("axtinguisher")
    W:pushString("backburner")
    W:pushString("blutsauger")
    W:pushString("bonk")
    W:pushString("cloakndagger")
    W:pushString("dalokohsbar")
    W:pushString("directhit")
    W:pushString("equalizer")
    W:pushString("sword")
    W:pushString("flaregun")
    W:pushString("forceanature")
    W:pushString("homewrecker")
    W:pushString("huntsman")
    W:pushString("jarate")
    W:pushString("kgb")
    W:pushString("natascha")
    W:pushString("paintrain")
    W:pushString("sandman")
    W:pushString("sandvich")
    W:pushString("scottishresistance")
    W:pushString("ubersaw")
    W:pushString("tf_weapon_bat")
    W:pushString("tf_weapon_bonesaw")
    W:pushString("tf_weapon_bottle")
    W:pushString("tf_weapon_pda_engineer_build")
    W:pushString("tf_weapon_knife")
    W:pushString("tf_weapon_pda_engineer_destroy")
    W:pushString("tf_weapon_fireaxe")
    W:pushString("tf_weapon_fists")
    W:pushString("tf_weapon_flamethrower")
    W:pushString("tf_weapon_grenadelauncher")
    W:pushString("tf_weapon_club")
    W:pushString("tf_weapon_medigun")
    W:pushString("tf_weapon_minigun")
    W:pushString("tf_weapon_pipebomblauncher")
    W:pushString("tf_weapon_pistol")
    W:pushString("tf_weapon_pistol_scout")
    W:pushString("tf_weapon_revolver")
    W:pushString("tf_weapon_rocketlauncher")
    W:pushString("tf_weapon_smg")
    W:pushString("tf_weapon_sapper")
    W:pushString("tf_weapon_scattergun")
    W:pushString("tf_weapon_shotgun_primary")
    W:pushString("tf_weapon_shotgun_hwg")
    W:pushString("tf_weapon_shotgun_pyro")
    W:pushString("tf_weapon_shotgun_soldier")
    W:pushString("tf_weapon_sniperrifle")
    W:pushString("tf_weapon_syringegun_medic")
    W:pushString("tf_weapon_wrench")
    
}
