Forum

> > CS2D > Scripts > Killing Floor mod
Forums overviewCS2D overview Scripts overviewLog in to reply

English Killing Floor mod

5 replies
To the start Previous 1 Next To the start

old Killing Floor mod

PhoenixWright
User Off Offline

Quote
Okay so I'm trying to make a killing floor mod, And I have the classes all created, I edited the Sample class lua, But When in game the zombies can also select from the classes, How do I make it to where only the survivors can select the classes? Plus the zombies seem to be able to take a ton of damage, and kill humans with 1 hit.

old Re: Killing Floor mod

Dovahkin
User Off Offline

Quote
Just use wpndmg or in the console!

1
2
parse("mp_wpndmg Claw 999")
parse("mp_wpndmg Gutbomb 999")

old Re: Killing Floor mod

PhoenixWright
User Off Offline

Quote
--------------------------------------------------
-- Player Classes Script by Unreal Software --
-- 28.02.2009 - www.UnrealSoftware.de --
-- Adds Player Classes to your server --
--------------------------------------------------

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

-----------------------
-- INITIAL SETUP --
-----------------------
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end
sample.classes.class=initArray(32)
function sample.classes.classmenu(id)
     menu(id,"Select your Class,Firebug|Flamethrower,Commando|Aug,Support|Shotguns,Sharpshooter|AutoSniper,Beserker|Melee,Demo|GrenadeLauncher")     
end


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


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


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


-----------------------
-- SPAWN --
-----------------------
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
     -- Firebug
     if (sample.classes.class[id]<=1) then
          parse ("setmaxhealth "..id.." 100")
          parse ("setarmor "..id.." 100")
          parse ("speedmod "..id.." 0")
          return "46,5,51";
     end
     -- Commando
     if (sample.classes.class[id]==2) then
          parse ("setmaxhealth "..id.." 100")
          parse ("setarmor "..id.." 100")
          parse ("speedmod "..id.." 0")
          return "33,1,51";
     end
     -- Support
     if (sample.classes.class[id]==3) then
          parse ("setmaxhealth "..id.." 100")
          parse ("setarmor "..id.." 100")
          return "10,11,6,51";
     end
     -- Sharpshooter
     if (sample.classes.class[id]==4) then
          parse ("setmaxhealth "..id.." 100")
          parse ("setarmor "..id.." 100")
          return "36,3,3,51";
     end
     -- Beserker
     if (sample.classes.class[id]==5) then
          parse ("setmaxhealth "..id.." 100")
          parse ("setarmor "..id.." 300")
          parse ("speedmod "..id.." 0")
          return "69,85,4";
     end
     -- Demo
     if (sample.classes.class[id]==6) then
          parse ("setmaxhealth "..id.." 75")
          parse ("setarmor "..id.." 25")
          return "49,53,53,53,53,1,77";
     end
end


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


-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","sample.classes.walkover")
function sample.classes.walkover(id,iid,type)
     if (type>=61 and type<=68) then
          return 0
     end
     return 1
end


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


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

old Re: Killing Floor mod

Bowlinghead
User Off Offline

Quote
Maybe you can add /code...

Spoiler >


1. QUESTION: You have to put the team classes to 2.
This means
1
2
3
4
5
6
7
8
9
-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","sample.classes.team")
function sample.classes.team(id,team)
if (team==2) then
sample.classes.classmenu(id)
end
end
Now ONLY Team 2 /CT see the Classes! The Team 1/TT see nothing!

TIPP: If you write your own script, it's easier to find bugs!

2. QUESTION:

1
2
3
4
5
6
7
addhook ("team","sample.classes.hurt")
function sample.classes.hurt(id,team)
	if team==1 then
	parse("mp_wpndmg 250")

	if team==2 then
	parse("mp_wpndmg 10")

old Re: Killing Floor mod

Dovahkin
User Off Offline

Quote
Maybe this will do!

Spoiler >


that will work
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview