Spoiler 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.classct=initArray(32)
function sample.classes.classmenuct(id)
menu(id,"Select your Class,Silence Gunner|Tmp/Deagle,Sniper Assassin|Scout/Deagle,Silence Rifleman|M4A1/Deagle,Sniper|Awp/Deagle,Assassin|Machete/Usp,Pistoler|Usp/Deagle")
end
-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","sample.classesct.team")
function sample.classes.teamct(id,team)
if (team>2) then
sample.classes.classmenuct(id)
end
end
-----------------------
-- SERVERACTION --
-----------------------
addhook("serveraction","sample.classes.serveractionct")
function sample.classes.serveractionct(id)
sample.classes.classmenuct(id)
end
-----------------------
-- CLASS SELECTION --
-----------------------
addhook("menu","sample.classes.menuct")
function sample.classes.menuct(id,menu,sel)
if (menu=="Select your Class") then
if (sel>=0 and sel<=6) then
sample.classes.classct[id]=sel
if (player(id,"health")>0) then
parse("killplayer "..id)
end
end
end
end
-----------------------
-- Classes --
-----------------------
addhook("spawn","sample.classes.spawnct")
function sample.classes.spawnct(id)
-- Silence Gunner
if (sample.classes.classct[id]<=1) then
parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 0")
return "21,1";
end
-- Sniper Assassin
if (sample.classes.classct[id]==2) then
parse ("setarmor "..id.." 75")
parse ("speedmod "..id.." 0")
return "34,1";
end
-- Silence Rifleman
if (sample.classes.classct[id]==3) then
parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 0")
return "32,1";
end
-- Sniper
if (sample.classes.classct[id]==4) then
parse ("setarmor "..id.." 75")
parse ("speedmod "..id.." 0")
return "35,3";
end
-- Assassin
if (sample.classes.classct[id]==5) then
parse ("setarmor "..id.." 50")
parse ("speedmod "..id.." 7")
return "69,1";
end
-- Pistoler
if (sample.classes.classct[id]==6) then
parse ("setarmor "..id.." 50")
parse ("speedmod "..id.." 3")
return "1,3,4";
end
end
Spoiler 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,Gunner|Mp5/Deagle,Auto Sniper|SG550/Deagle,Rifleman|Ak47/Deagle,Sniper|Awp/Deagle,Heavy Gunner|MG/Deagle,Pistoler|FiveSeven/Deagle")
end
-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","sample.classes.team")
function sample.classes.team(id,team)
if (team>1) 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
-----------------------
-- Classes --
-----------------------
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
-- Gunner
if (sample.classes.class[id]<=1) then
parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 0")
return "20,3";
end
-- Auto Sniper
if (sample.classes.class[id]==2) then
parse ("setarmor "..id.." 60")
parse ("speedmod "..id.." 0")
return "36,3";
end
-- Rifleman
if (sample.classes.class[id]==3) then
parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 0")
return "30,3";
end
-- Sniper
if (sample.classes.class[id]==4) then
parse ("setarmor "..id.." 75")
parse ("speedmod "..id.." 0")
return "35,3";
end
-- Heavy Gunner
if (sample.classes.class[id]==5) then
parse ("setarmor "..id.." 150")
parse ("speedmod "..id.." -5")
return "40,3";
end
-- Pistoler
if (sample.classes.class[id]==6) then
parse ("setarmor "..id.." 75")
parse ("speedmod "..id.." 3")
return "3,6";
end
end