Spoiler if cod==nil then cod={} end
cod.classes={}
-----------------------
-- INITIAL SETUP --
-----------------------
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
cod.classes.class=initArray(32)
function cod.classes.classmenu(id)
if (player(id,"team") == 1) then
menu(id,"Select your Class,~>Soldier|Go Go Go !,~>Marenz|Sur yes Sur !,~>Gerandes man|BOMMMB !,~>Sniper|Nap time,~>ENGINEER|Build the Base !,~>Tank Destroyer|Any Tanks!,~>Shields|Cover Has Arrive!")
end
if (player(id,"team") == 2) then
menu(id,"Select Your Class,~>Russian soldier|For mother russia,~>RAMBO|Take cover !,~>Scouter|Cover Me !,~>ENGINEER|Build the Base !,~>Teleoprter|Light Speed !,~>HitMan|Run For Your Life,~>Marathon Killer !|Catch me if you can !")
end
end
-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","cod.classes.team")
function cod.classes.team(id,team)
if (team>0) then
cod.classes.classmenu(id)
end
end
-----------------------
-- SERVERACTION --
-----------------------
addhook("serveraction","cod.classes.serveraction")
function cod.classes.serveraction(id)
cod.classes.classmenu(id)
end
-----------------------
-- CLASS SELECTION --
-----------------------
addhook("menu","cod.menu")
function cod.menu(id,menu,sel)
if (menu=="Select Your Class") then
if (sel>=0 and sel<=7) then
cod4.class[id]=sel
if (player(id,"health")>0) then
parse("killplayer "..id)
parse("setdeaths "..id.." "..player(id,"deaths")-1)
return 1
end
end
end
end
-----------------------
-- SPAWN --
-----------------------
addhook("spawn","cod.classes.spawn")
function cod.classes.spawn(id)
if (player(id,"team") == 1) then
-- ~>Soldier
if (cod.classes.class[id]<=1) then
msg2(id,"©000255000Current Class:~>Soldier")
parse('hudtxt2 '..id..' 5 "©000255000Your Class is: Soldier" 42 400')
parse ("setmaxhealth "..id.." 130")
parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." -2")
return "32,1,51,20,59";
end
-- ~>Marenz
if (cod.classes.class[id]==2) then
msg2(id,"©000255000Current Class:~>Marenz")
parse('hudtxt2 '..id..' 5 "©000255000Your Class is: Marenz" 42 400')
parse ("setmaxhealth "..id.." 120")
parse ("setarmor "..id.." 50")
return "33,5,59,21,51";
end
-- ~>Gerandes man
if (cod.classes.class[id]==3) then
msg2(id,"©000255000Current Class:~>Gerandes man")
parse('hudtxt2 '..id..' 5 "©000255000Your Class is: Gerandes man" 42 400')
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 75")
return "77,87,73,72,20,59,51";
end
-- ~>Sniper
if (cod.classes.class[id]==4) then
msg2(id,"©000255000Current Class:~>Sniper")
parse('hudtxt2 '..id..' 5 "©000255000Your Class is: Sniper" 42 400')
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 25")
return "35,34,53,3,59,51";
end
-- ~>ENGINEER
if (cod.classes.class[id]==5) then
msg2(id,"©000255000Current Class:~>ENGINEER")
parse('hudtxt2 '..id..' 5 "©000255000Your Class is: ENGINEER" 42 400')
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 25")
return "74,22,4,85,59,51";
end
-- ~>Tank Destroyer
if (cod.classes.class[id]==6) then
msg2(id,"©000255000Current Class:~>Tank Destroyer")
parse('hudtxt2 '..id..' 5 "©000255000Your Class is: Tank Destroyer" 42 400')
parse ("setmaxhealth "..id.." 50")
parse ("setarmor "..id.." 25")
return "47,4,59,51";
end
-- ~>Shields
if (cod.classes.class[id]==7) then
msg2(id,"©000255000Current Class:~>Shields")
parse('hudtxt2 '..id..' 5 "©000255000Your Class is: Shields" 42 400')
parse ("setmaxhealth "..id.." 100")
parse ("setarmor "..id.." 100")
return "41,11,3,59,51";
end
end
if (player(id,"team") == 2) then
-- ~>Russian soldier
if (cod.classes.class[id]<=1) then
parse ("setmaxhealth "..id.." 150")
parse ("setarmor "..id.." 202")
parse ("speedmod "..id.." -5")
return "40,4,51";
end
-- ~>RAMBO
if (cod.classes.class[id]==2) then
parse ("setmaxhealth "..id.." 100")
parse ("setarmor "..id.." 206")
parse ("speedmod "..id.." 5")
return "21,1";
end
-- ~>Scouter
if (cod.classes.class[id]==3) then
parse ("setmaxhealth "..id.." 100")
parse ("setarmor "..id.." 50")
return "10,2,74";
end
-- ~>ENGINEER
if (cod.classes.class[id]==4) then
parse ("setmaxhealth "..id.." 125")
parse ("setarmor "..id.." 75")
return "46,6,73";
end
-- ~>Teleoprter
if (cod.classes.class[id]==5) then
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 0")
parse ("speedmod "..id.." 15")
return "5,69,54";
end
-- ~>HitMan
if (cod.classes.class[id]==6) then
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 25")
return "35,3,53";
end
-- ~>Marathon Killer !
if (cod.classes.class[id]==6) then
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 25")
return "35,3,53";
end
end
-----------------------
-- NO BUYING --
-----------------------
addhook("buy","cod.classes.buy")
function cod.classes.buy()
return 1
end
-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","cod.classes.walkover")
function cod.classes.walkover(id,iid,type)
if (type>=61 and type<=68) then
return 0
end
return 1
end
-----------------------
-- NO DROPPING --
-----------------------
addhook("drop","cod.classes.drop")
function cod.classes.drop()
return 1
end
-----------------------
-- NO DEAD DROPPING --
-----------------------
addhook("die","cod.classes.die")
function cod.classes.die()
return 1
end
end