--------------------------------------------------
-- Player Classes Script by Unreal Software --
-- 28.02.2009 -
www.UnrealSoftware.de --
-- Adds Player Classes to your server --
--------------------------------------------------
parse("mp_wpndmg mine 35")
parse("mp_wpndmg GrenadeLauncher 40")
parse("mp_wpndmg LaserMine 35")
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,Defender,Sniper,Mine,Grenader,Commandos")
end
-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","sample.classes.team")
function sample.classes.team(id,team)
if (team>2) 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<=5) 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)
-- Defender
if (sample.classes.class[id]<=1) then
parse ("setmaxhealth "..id.." 150")
parse ("setarmor "..id.." 200")
parse ("equip "..id.." 40")
parse ("equip "..id.." 2")
parse ("equip "..id.." 1")
parse ("speedmod "..id.." 2")
return "40,2,1";
end
-- Sniper
if (sample.classes.class[id]<=2) then
parse ("equip "..id.." 35")
parse ("equip "..id.." 34")
parse ("equip "..id.." 3")
parse ("equip "..id.." 53")
parse ("setmaxhealth "..id.." 125")
parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." 4")
return "35,34,3,53";
end
-- Miner
if (sample.classes.class[id]<=3) then
parse ("equip "..id.." 38")
parse ("equip "..id.." 4")
parse ("equip "..id.." 87")
parse ("equip "..id.." 77")
parse ("setmaxhealth "..id.." 100")
parse ("setarmor "..id.." 175")
parse ("speedmod "..id.." 2")
return "38,4,87,77";
end
-- Grenader
if (sample.classes.class[id]<=4) then
parse ("equip "..id.." 49")
parse ("equip "..id.." 4")
parse ("equip "..id.." 51")
parse ("equip "..id.." 73")
parse ("equip "..id.." 76")
parse ("setmaxhealth "..id.." 120")
parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." 2")
return "49,4,51,73,76";
end
-- Commandos
if (sample.classes.class[id]<=5) then
parse ("equip "..id.." 69")
parse ("equip "..id.." 6")
parse ("equip "..id.." 33")
parse ("setweapon "..id.." 69")
parse ("setmaxhealth "..id.." 138")
parse ("setarmor "..id.." 138")
parse ("speedmod "..id.." 6")
parse ("strip "..id.." 50")
return "69,6,33";
end
end
-----------------------
-- NO BUYING --
-----------------------
addhook("buy","buy")
function buy()
return 1
end
-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","walkover")
function walkover(id,iid,type)
if (type>=1 and type<=88) then
return 1
end
return 0
end
-----------------------
-- NO DROPPING --
-----------------------
addhook("drop","drop")
function drop()
return 1
end
-----------------------
-- NO DEAD DROPPING --
-----------------------
addhook("die","sample.classes.die")
function sample.classes.die()
return 1
end