Hi i'd found a cool script called CODMW 2d but i wanna add more class to his and i don't know how to do this! I never working with scripts and i don't wanna crush this so please help me!
This is the lua file with classes to cod mod (PS: i'm from Poland so sorry but my english it's hard to read ;p)
if sample==nil then sample={} end cod4={}
-- INITIAL SETUP --
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
cod4.class=initArray(32)
function cod4.classmenu(id)
menu(id,"CoD-MW2D HEROS,Soldier|Go Go Go !,Russian soldier|For mother russia,marenz|Sur yes Sur !,Bomar man|BOMMMB !,RAMBO|Take cover !,Sniper|Nap time,ENGINEER|Build the base!,tank destroyer|any tanks!,Shields|cover has arrive!")
end
-- TEAM -> CLASS --
addhook("team","cod4.team") function cod4.team(id,team) if (team>0) then cod4.classmenu(id) end end
-- SERVERACTION --
addhook("serveraction","cod4.serveraction") function cod4.serveraction(id) cod4.classmenu(id) end
-- CLASS SELECTION --
addhook("menu","cod4.menu") function cod4.menu(id,menu,sel) if (menu=="CoD-MW2D HEROS") then if (sel>=0 and sel<=9) 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","cod4.spawn")
function cod4.spawn(id)
if (cod4.class[id]==0) then
cod4.class[id]=math.random(1,9)
end
-- Soldier
if (cod4.class[id]<=1) then
msg2(id,"©000255000Current Hero: Soldier")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: Soldier" 42 400')
parse ("setmaxhealth "..id.." 130")
parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." -2")
return "32,1,51,20,59";
end
-- Russian Soldier
if (cod4.class[id]<=2) then
msg2(id,"©000255000Current Hero: Russian Soldier")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: Russian Soldier" 42 400')
parse ("setmaxhealth "..id.." 130")
parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." -2")
return "30,2,51,20,59";
end
-- Marenz
if (cod4.class[id]<=3) then
msg2(id,"©000255000Current Hero: Mrenz")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: Marenz" 42 400')
parse ("setmaxhealth "..id.." 120")
parse ("setarmor "..id.." 50")
return "33,5,59,21,51";
end
-- gerandes man
if (cod4.class[id]<=4) then
msg2(id,"©000255000Current Hero: Gerndes man")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: gerandes man" 42 400')
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 75")
return "77,87,73,72,20,59,51";
end
-- RAMBO
if (cod4.class[id]<=5) then
msg2(id,"©000255000Current Hero: RAMBO")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: RAMBO" 42 400')
parse ("setmaxhealth "..id.." 100")
parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 15")
return "5,69,40,59,51";
end
-- SNIPER
if (cod4.class[id]<=6) then
msg2(id,"©000255000Current Hero: Sniper")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: Sniper" 42 400')
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 25")
return "35,34,53,3,59,51";
end
-- ENGINEER
if (cod4.class[id]<=7) then
msg2(id,"©000255000Current Hero: ENGINEER")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: ENGINEER" 42 400')
parse ("setmaxhealth "..id.." 75")
parse ("setarmor "..id.." 25")
return "74,22,4,85,59,51";
end
-- Tank Destroyer
if (cod4.class[id]<=8) then
msg2(id,"©000255000Current Hero: Tank Destroyer ")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: Tank Destroyer" 42 400')
parse ("setmaxhealth "..id.." 50")
parse ("setarmor "..id.." 25")
return "47,4,59,51";
end
-- Shields
if (cod4.class[id]<=9) then
msg2(id,"©000255000Current Hero: Shields")
parse('hudtxt2 '..id..' 5 "©000255000Your Hero is: Shields" 42 400')
parse ("setmaxhealth "..id.." 100")
parse ("setarmor "..id.." 100")
return "41,11,3,59,51";
end
end
-- NO BUYING --
addhook("buy","cod4.buy") function cod4.buy() return 1 end
-- NO COLLECTING --
addhook("walkover","cod4.walkover") function cod4.walkover(id,iid,type) if (type>=61 and type<=68) then return 0 end return 1 end
-- NO DROPPING --
addhook("drop","cod4.drop") function cod4.drop() return 1 end
-- NO DEAD DROPPING --
addhook("die","cod4.die") function cod4.die() return 1 end
-- msg --
addhook("minute","cod4.msges") function cod4.msges() msg("©190255050 ==Call of Duty modern warfare 2D mod") msg("©190255050 ==E-mail:malook39@hotmail.com") msg("©190255050 ==Created by BLACK_J93") msg("©190255050 ==Have Fun :~)") end
-- move --
addhook("move","cod4.move") function cod4.move(id,x,y,walk) rot = player(id,"rot") parse('hudtxt2 '..id..' 3 "©000255000Coordinates X: '..x..' Y: '..y..' " 13 105') end addhook("movetile","cod4.movet") function cod4.movet(id,x,y) parse('hudtxt2 '..id..' 8 "©000255000Tile Coordinates X: '..x..' Y: '..y..' " 13 130') end
-- COD recovery Hp system --
addhook("second","cod4.heal") function cod4.heal() local i, health for i = 1, 32 do health = player(i,"health") if (player(i,"exists")) then parse("sethealth "..i.." "..(health + 4)) end end end
-- hurt msg --
addhook("hit","cod4.hit") function cod4.hit(id,src,wpn,hpdmg) if player(id,"health")-hpdmg < 30 then msg2(id,"©255255255You are hurt, Get Cover!@C") end
end
-- welcome msg --
addhook("team","cod4.team") function cod4.team(p,tm) if tm==1 then msg2(p,"©000255000=Welcome to Server, "..player(p,"name").."!") msg2(p,"©190255050=current script CoD MW-2D!") end if tm==2 then msg2(p,"©000255000=Welcome to server, "..player(p,"name").."!") msg2(p,"©190255050=current script CoD MW-2D!") end end
if cod4==nil then cod4={} end
addhook("team","cod4.title") function cod4.title(id) parse('hudtxt2 '..id..' 7 "©000255000Call Of Duty Modern Warfare 2D Mod" 247 13') parse('hudtxt2 '..id..' 9 "©160160255'..game("sv_name")..'" 260 26') end
I wanna add here this class:
-- Rusher
if (cod4.class[id]<=10) then
msg2(id,"©000255000Aktywna Klasa: Rusher")
parse('hudtxt2 '..id..' 5 "©000255000Twoja Klasa: Rusher" 42 400')
parse ("setmaxhealth "..id.." 125")
parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 40")
return "69,50";
end
How to do this?? :)
Download lua Script: http://www.unrealsoftware.de/get.php?get=u11311f8.zip&p=2

