Forum

> > CS2D > Scripts > Classes
Forums overviewCS2D overview Scripts overviewLog in to reply

English Classes

4 replies
To the start Previous 1 Next To the start

old Classes

FredoMaster
User Off Offline

Quote
hello i need help.i want do classes only for 1 team and i dont know how to do it, can somebody help ?

i have complete classes but i want set it only for 1 team
edited 1×, last 26.04.14 12:31:54 am

old Re: Classes

FredoMaster
User Off Offline

Quote
--------------------------------------------------
-- Team Fortress v.0.5 by Dragon Fang --
--------------------------------------------------

if TF==nil then TF={} end
TF.classes={}

-----------------------
-- INITIAL SETUP --
-----------------------
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end
TF.classes.class=initArray(32)
function TF.classes.classmenu(id)
     menu(id,"Select your Class,Scout,Soldier,Pyro,Demoman,Heavy,Engineer,Medic,Sniper,Spy")     
end



-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","TF.classes.team")
function TF.classes.team(id,team)
     if (team>0) then
          TF.classes.classmenu(id)
     end
end


-----------------------
-- SERVERACTION --
-----------------------
addhook("serveraction","TF.classes.serveraction")
function TF.classes.serveraction(id)
     TF.classes.classmenu(id)
end


-----------------------
-- CLASS SELECTION --
-----------------------
addhook("menu","TF.classes.menu")
function TF.classes.menu(id,menu,sel)
     if (menu=="Select your Class") then
          if (sel>=0 and sel<=9) then
               TF.classes.class[id]=sel
               if (player(id,"health")>0) then
                    parse("killplayer "..id)
               end
          end
     end
end


-----------------------
-- SPAWN --
-----------------------
addhook("spawn","TF.classes.spawn")
function TF.classes.spawn(id)

if (TF.classes.class[id]==0) then
TF.classes.class[id]=math.random(1,9)
end
     -- Scout
     if (TF.classes.class[id]<=1) then
          parse ("setmaxhealth "..id.." 125")
          parse ("setarmor "..id.." 50")
          parse ("speedmod "..id.." 12")
          parse ("mp_wpndmg Machete 65")
          parse ("mp_wpndmg knife 10")
          parse ("mp_wpndmg_z1 knife 25")
          msg2(id,"You Are: A Scout!")
          parse('hudtxt2 '..id..' 5 "Class: Scout" 200 400')
          return "11,4,69,79";
     end
     -- Soldier
     if (TF.classes.class[id]==2) then
          parse ("setmaxhealth "..id.." 200")
          parse ("setarmor "..id.." 150")
          parse ("speedmod "..id.." -3")
          parse ("mp_wpndmg RPG Launcher 100")
          parse ("mp_wpndmg Machete 65")
          parse ("mp_wpndmg knife 10")
          parse ("mp_wpndmg_z1 knife 25")
          msg2(id,"You Are: A Soldier!")
          parse('hudtxt2 '..id..' 5 "Class: Soldier" 200 400')
          return "47,10,51,69,80";
     end
     -- Pyro
     if (TF.classes.class[id]==3) then
          parse ("setmaxhealth "..id.." 175")
          parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." 0")
          parse ("mp_wpndmg Machete 65")
          parse ("mp_wpndmg knife 10")
          parse ("mp_wpndmg_z1 knife 25")
          msg2(id,"You Are: A Pyro!")
          parse('hudtxt2 '..id..' 5 "Class: Pyro" 200 400')
          return "46,10,73,69,80";
     end
     -- Demoman
     if (TF.classes.class[id]==4) then
          parse ("setmaxhealth "..id.." 175")
          parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." -1")
          parse ("mp_wpndmg Machete 65")
          parse ("mp_wpndmg knife 10")
          parse ("mp_wpndmg_z1 knife 25")
          msg2(id,"You Are: A Demoman!")
          parse('hudtxt2 '..id..' 5 "Class: Demoman" 200 400')
          return "49,51,77,53,87,69,80";
     end
     -- Heavy
     if (TF.classes.class[id]==5) then
          parse ("setmaxhealth "..id.." 300")
          parse ("setarmor "..id.." 200")
          parse ("speedmod "..id.." -6")
          parse ("mp_wpndmg knife 65")
          parse ("mp_wpndmg_z1 knife 110")
          msg2(id,"You Are: A Heavy Weapons Guy!")
          parse('hudtxt2 '..id..' 5 "Class: Heavy" 200 400')
          return "40,10,57,81";
     end
     -- Engineer
     if (TF.classes.class[id]==6) then
          parse ("setmaxhealth "..id.." 125")
          parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 0")
          parse ("mp_wpndmg knife 10")
          parse ("mp_wpndmg_z1 knife 25")
          msg2(id,"You Are: An Engineer!")
          parse('hudtxt2 '..id..' 5 "Class: Engineer" 200 400')
          return "11,4,74,79";
     end
     -- Medic
     if (TF.classes.class[id]==7) then
          parse ("setmaxhealth "..id.." 150")
          parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 1")
          parse("mp_wpndmg laser 0")
          parse ("mp_wpndmg knife 10")
          parse ("mp_wpndmg_z1 knife 25")
          msg2(id,"You Are: A Medic!")
          parse('hudtxt2 '..id..' 5 "Class: Medic" 200 400')
          return "21,82,85";
     end
     -- Sniper
     if (TF.classes.class[id]==8) then
          parse ("setmaxhealth "..id.." 125")
          parse ("setarmor "..id.." 50")
parse ("speedmod "..id.." 0")
          parse ("mp_wpndmg Machete 65")
          parse ("mp_wpndmg knife 10")
          parse ("mp_wpndmg_z1 knife 25")
          msg2(id,"You Are: A Sniper!")
          parse('hudtxt2 '..id..' 5 "Class: Sniper" 200 400')
          return "35,21,53,69,79";
     end
     -- Spy
     if (TF.classes.class[id]==9) then
          parse ("setmaxhealth "..id.." 125")
          parse ("setarmor "..id.." 206")
parse ("speedmod "..id.." 4")
          parse ("mp_wpndmg_z1 knife 300")
          msg2(id,"You Are: A Spy!")
          parse('hudtxt2 '..id..' 5 "Class: Spy" 200 400')
          return "3,50,52,76,86,86";
     end
end



-----------------------
-- NO BUYING --
-----------------------
addhook("buy","TF.classes.buy")
function TF.classes.buy()
     return 1
end




-----------------------
-- NO DROPPING --
-----------------------
addhook("drop","TF.classes.drop")
function TF.classes.drop()
     return 1
end

-----------------------
-- NO DEAD DROPPING --
-----------------------
addhook("die","TF.classes.die")
function TF.classes.die()
     return 1
end

old Re: Classes

Marcell
Super User Off Offline

Quote
you would like to for Terrorist or for CTs?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview