i have a COD Script by LooSer and it sometimes saves the xp and level sometimes it doesn't for Eg. I achieve level 7 on one map and after a mapchange it stays the same level 7 yes, but i achieve level 16 on the map then after map change it goes back to level 7. so i decided i'm admin so ill just give myself level 37. so i went into the codsaves foler
(sys/lua/codsaves) and opened my number and changed the xp number to 1000 and i restart the server log in and my level is 100 which is fine by me even though the level limit cap is 37. that was this morning and i left the server running the whole day and i join back my server this evening and my level is 1. can someone please look at this code and tell me what to edit so that it saves properly? after each match and doesn't reset the xp.
Spoiler
----------------------------------------------------------------
-- Call of Duty mode by Loooser --
----------------------------------------------------------------
----------------------------------------------------------------
-- my weapons: --
----------------------------------------------------------------
--weapon id | weapon name | needed lvl | Extra weapon description
-- 1 USP -
-- 56 Defuse Kit -
-- 10 M3 -
-- 21 TMP -
-- 35 AWP -
-- 51 HE -
-- 90 Run Faster - You will run faster
-- 58 Kevlar + Helm -
-- 23 Mac 10 2
-- 2 Glock 3
-- 20 MP5 4
-- 38 Galil 5
-- 24 UMP45 6
-- 4 P228 7
-- 97 C4 7 you get 2 c4 packs (not finished jet)
-- 52 Flashbang 8
-- 37 SG550 9
-- 22 P90 10
-- 39 Famas 11
-- 53 Smoke Grenade 12
-- 6 Five-Seven 12
-- 30 AK-47 13
-- 11 XM1014 14
-- 54 Flare 15
-- 31 SG552 16
-- 5 Elite 17
-- 95 Faster Heal 17 You heal yourself faster (not finished jet)
-- 77 Mine 18
-- 34 Scout 19
-- 33 Aug 20
-- 3 Deagle 21
-- 36 G3SG1 22
-- 92 Last Stand 23 when die you will lie on ground and fire
-- 40 M249 24
-- 91 Hp 25 You get extra hp
-- 32 M4A1 26
-- 49 Grenade Launcher27
-- 95 Extra Ammo 28 You have extra ammo
-- 93 Drop He 29 when die you will drop a he
-- 89 RPG 30
-- 96 Secondary mashine Gun 31 You can have a mashine gun instead a pistol
-- 79 Light Armor 32
-- 94 More Damage X 33 You will make more damage
-- 99 Hardliner 34 you need 1 kill less for the killing streaks
-- 100 ammo thief 35 you can pick up ammo from weapons of ground (not finished jet)
-- 101 extra jet 36 you get a jet on spawn
-- 102 care package 37 you get he , ammo , hp
----------------------------------------------------------------
-- server settings --
----------------------------------------------------------------
if game("mp_damagefactor")~=1.5 then -- damage has to be 1.5 !!
parse('mp_damagefactor 1.5')
end
parse('sv_friendlyfire 0')
parse('mp_infammo 0') -- with inf ammo my Item Extra Ammo would be nothing !!
parse('mp_killinfo 0') -- there would be to many msg
parse('mp_autoteambalance 1') -- we need a fair game !!
if sample==nil then sample={} end
sample.ut={}
----------------------------------------------------------------
-- Vaules --
----------------------------------------------------------------
function array(m)
local array = {}
for i = 1, m do
array[i] = 0
end
return array
end
--Game Settings---------------------------------------------
cod_commands = {'cod_commands','cod_say','cod_players','cod_gpxp','cod_gpst'}
cod_commands_inf = {' - Console Commands',' - Say Commands List',' - Players List',' - Give player xp <id> <xp>',' - Give player streak <id> <streak> <amount>'}
color = {'©255200000','©000255000','©160160255','©255000000','©240000240','©255128064','©000000000'}
cod_mapx = map("xsize")
cod_mapy = map("ysize")
pl_count = game('sv_maxplayers')
cod_1_set = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
wpn_names = {'USP','Glock','Deagle','P228','Elite','Five-seven','-','-','-','M3','XM1014','-','-','-','-','-','-','-','-','MP5','TMP','P90','Mac 10','UMP45','-','-','-','-','-','AK-47','SG552','M4A1','Aug','Scout','AWP','G3SG1','SG550','Galil','Famas','M249'}
cod_nxp_ratio = 20
bestplayer = 'no'
cod_lvlm = 37
cod_info_lines = 0
cod_streak_lines = 0
cod_timer = array(32)
cod_level = array(32)
cod_fblood = 0
cod_info_lines = {}
cod_fpl32 = 0
--Player Information----------------------------------------
--Streak Vaules
cod_str_a = array(pl_count)
cod_jeta = array(pl_count)
cod_jet2a = array(pl_count)
cod_helia = array(pl_count)
cod_jet_save = array(pl_count)
cod_jet2_save = array(pl_count)
cod_jet = array(pl_count)
cod_jet2 = array(pl_count)
cod_turret = array(pl_count)
cod_harrier_strike = array(pl_count)
cod_tactical_nuke = array(pl_count)
cod_missle = array(pl_count)
cod_misslea = array(pl_count)
cod_extra_jet = array(pl_count)
cod_uavkill = array(pl_count)
cod_heli_attacked = array(pl_count)
cod_heli_attacked2 = array(pl_count)
cod_counteruava = array(pl_count)
cod_heli_life = array(pl_count)
cod_heli_timer = array(pl_count)
cod_heli_timer2 = array(pl_count)
cod_tkill = array(pl_count)
cod_fkill = array(pl_count)
cod_ffkill = array(pl_count)
cod_nuket = array(pl_count)
--Xp Vaules
cod_xp = array(pl_count)
cod_nxp = array(pl_count)
cod_lvl = array(pl_count)
--Slot Vaules
cod_slot = array(pl_count)
--slot1
cod_s1_w = array(pl_count)
cod_s1_w2 = array(pl_count)
cod_s1_e = array(pl_count)
cod_s1_e2 = array(pl_count)
cod_s1_g = array(pl_count)
cod_s1_wn = array(pl_count)
cod_s1_w2n = array(pl_count)
cod_s1_str4 = array(pl_count)
cod_s1_str6 = array(pl_count)
cod_s1_str15 = array(pl_count)
--slot2
cod_s2_w = array(pl_count)
cod_s2_w2 = array(pl_count)
cod_s2_e = array(pl_count)
cod_s2_e2 = array(pl_count)
cod_s2_g = array(pl_count)
cod_s2_wn = array(pl_count)
cod_s2_w2n = array(pl_count)
cod_s2_str4 = array(pl_count)
cod_s2_str6 = array(pl_count)
cod_s2_str15 = array(pl_count)
--slot3
cod_s3_w = array(pl_count)
cod_s3_w2 = array(pl_count)
cod_s3_e = array(pl_count)
cod_s3_e2 = array(pl_count)
cod_s3_g = array(pl_count)
cod_s3_wn = array(pl_count)
cod_s3_w2n = array(pl_count)
cod_s3_str4 = array(pl_count)
cod_s3_str6 = array(pl_count)
cod_s3_str15 = array(pl_count)
--extra vaules
cod_ammo = array(pl_count)
cod_lstand = array(pl_count)
cod_exr = array(pl_count)
cod_extg = array(pl_count)
cod_lasts = array(pl_count)
cod_last_kill = array(pl_count)
tiley = array(pl_count)
tilex = array(pl_count)
cod_extrad = array(pl_count)
tileok = array(pl_count)
cod_hardliner = array(pl_count)
--other
cod_senx = array(pl_count)
cod_seny = array(pl_count)
cod_info = array(pl_count)
cod_streakinfo = array(pl_count)
--building
cod_pl_x = array(pl_count)
cod_pl_y = array(pl_count)
cod_b_mo = array(pl_count)
cod_pl_w = array(pl_count)
cod_b_t = array(pl_count)
----------------------------------------------------------------
-- ADDHOOKS --
----------------------------------------------------------------
addhook("second","cod_heal")
addhook("kill","cod_kill")
addhook("say","cod_say")
addhook("team","cod_team")
addhook("spawn","cod_spawn")
addhook("menu","cod_menu")
addhook("serveraction","cod_serveraction")
addhook("die","cod_die")
addhook("leave","cod_leave")
addhook("minute","cod_min")
addhook("dominate","cod_dominate")
addhook("bombplant","cod_bombplant")
addhook("bombdefuse","cod_bombdefuse")
addhook("parse","cod_parse")
addhook("hit","cod_hit")
addhook("ms100","cod_ms100")
addhook("walkover","cod_walkover")
addhook("drop","cod_drop")
addhook("buy","cod_buy")
addhook("projectile","cod_projectile")
addhook("mapchange","cod_mapchange")
addhook("join","cod_join")
addhook("startround","cod_startround")
addhook("movetile","cod_movetile")
addhook("always","cod_always")
addhook("objectdamage","cod_objectdamage")
----------------------------------------------------------------
-- FUNCTIONS WITH HOOKS --
----------------------------------------------------------------
function cod_objectdamage(id,damage,player)
if player==object(id,"player") then
if cod_pl_w[player]==50 then
if object(id,"type")==8 then
cod_b_t[player] = object(id,"type")
parse("killobject "..id)
cod_b_mo[player] = 1
return 1
end
end
end
end
function cod_always()
for i = 1, 32 do
cod_pl_w[i] = player(i,"weapontype")
end
end
function cod_movetile(id,x,y)
if cod_seny[id]~=0 and cod_senx[id]~=0 then
parse("spawnobject 8 "..cod_senx[id].." "..cod_seny[id].." 1 1 "..player(id,"team").." "..id)
cod_seny[id] = 0
cod_senx[id] = 0
end
if cod_b_mo[id]==1 then
cod_b_mo[id] = 0
parse("spawnobject "..cod_b_t[id].." "..cod_pl_x[id].." "..cod_pl_y[id].." 0 0 "..player(id,"team").." "..id)
end
cod_pl_x[id] = player(id,"x")/32
cod_pl_y[id] = player(id,"y")/32
end
function cod_startround()
for p = 1, 32 do
cod_tactical_nuke[p] = 0
cod_tkill[p] = 0
cod_fkill[p] = 0
cod_uavkill[p] = 0
cod_harrier_strike[p] = 0
cod_ffkill[p] = 0
cod_missle[p] = 0
cod_turret[p] = 0
end
end
function cod_mapchange()
cod_mapx = map("xsize")
cod_mapy = map("ysize")
end
function cod_projectile(id,weapon,x,y)
if weapon==54 then
tiley[id] = y
tilex[id] = x
tileok[id] = 1
elseif weapon==76 then
local xx = x / 32
local yy = y / 32
parse("spawnitem 65 "..xx.." "..yy.."")
parse("spawnitem 61 "..xx.." "..yy.."")
parse("spawnitem 62 "..xx.." "..yy.."")
return 1
end
end
function cod_buy(id)
cod_msg2(id,4,"Buying Disabled!@C")
return 1
end
function cod_drop(id,iid,type)
if type<55 and type>46 then
return 1
end
end
function cod_walkover(id,iid,type)
if type<55 and type>46 then
return 1
end
end
function cod_ms100()
for p = 1, 32 do
if player(p,"exists") then
if cod_counteruava[p]>=1 then
cod_counteruava[p]=cod_counteruava[p]-1
cod_drone(p)
end
end
end
end
function cod_hit(id,s,h,wpn)
if cod_misslea[s]==1 then
cod_misslea[s] = 0
local a = player(id,"x")
local b = player(id,"y")
cod_predator(s,a,b,id)
end
if player(s,"exists") then
if cod_extrad[s]==1 then
local dmg = h + (h*0.75)
if player(id,"health") - dmg > 0 then
parse('sethealth '..id..' ' ..player(id,"health") - dmg)
return 1
else
end
end
if player(id,"health") - h <= 0 then
if cod_lasts[id]==1 then
cod_last_kill[id] = 1
cod_lasts[id] = 0
cod_msg2(id,4,'Last stand!!@C')
cod_msg2(id,3,'Press F3 to die!!@C')
cod_speed(id,-100)
parse('sethealth '..id..' 100')
return 1
end
end
end
end
function cod_bombdefuse(id)
cod_msg2(id,4,'You get extra Xp for Bombdefusing!!')
give_xp(id,100)
end
function cod_bombplant(id)
cod_msg2(id,4,'You get extra Xp for Bombplanting!!')
give_xp(id,50)
end
function cod_dominate(id)
cod_msg2(id,4,'You get extra Xp for dominating!!')
give_xp(id,50)
end
function cod_min()
if cod_fpl32==1 then
cod_msg(4,'The first Player who reached Level '..cod_lvlm..' is '..bestplayer)
end
end
function cod_leave(id)
cod_1_set[id] = 1
cod_leave_save(id)
end
function cod_die(victim)
if cod_lstand[victim]==1 then
local x = player(victim,"x")
local y = player(victim,"y")
cod_explosion(victim,150,x,y)
end
end
function cod_spawn(id)
parse("strip "..id)
if cod_extra_jet[id]==1 then
cod_extra_jet[id] = 0
cod_tkill[id] = cod_tkill[id] + 1
end
if cod_hardliner[id]==1 then
cod_hardliner[id] = 0
cod_level[id] = 1
end
cod_spawnflare(id)
cod_last_kill[id] = 0
cod_extrad[id] = 0
if player(id,"bot") then
else
cod_equip(id,51)
end
if cod_slot[id]==1 then
cod_equip(id,cod_s1_w[id])
cod_equip(id,cod_s1_w2[id])
cod_equip(id,cod_s1_e[id])
if player(id,"bot") then
else
cod_equip(id,cod_s1_g[id])
end
cod_equip(id,cod_s1_e2[id])
elseif cod_slot[id]==2 then
cod_equip(id,cod_s2_w[id])
cod_equip(id,cod_s2_w2[id])
cod_equip(id,cod_s2_e[id])
cod_equip(id,cod_s2_e2[id])
if player(id,"bot") then
else
cod_equip(id,cod_s2_g[id])
end
elseif cod_slot[id]==3 then
cod_equip(id,cod_s3_w[id])
cod_equip(id,cod_s3_w2[id])
cod_equip(id,cod_s3_e[id])
cod_equip(id,cod_s3_e2[id])
if player(id,"bot") then
else
cod_equip(id,cod_s3_g[id])
end
end
end
function cod_say(id,words)
if words=='!help' then
cod_msg2(id,3,'Help Info:')
cod_msg2(id,3,'Press f4 to send a airstrike or heli')
cod_msg2(id,3,'Press f2 to set up your slot with your new weapons')
elseif words=='rank' or words=='Rank' or words=='RAnk' or words=='RANk' or words=='RANK' or words=='ranK' or words=='raNK' or words=='rANK' then
cod_msg(6,player(id,"name")..' is on rank:')
cod_msg(6,'Level: '..cod_lvl[id]..', Expierience: ('..cod_xp[id]..'|'..cod_nxp[id]..').')
elseif words=='!run faster' then
cod_msg2(id,3,'You will run a bit faster')
return 1
elseif words=='!last stand' then
cod_msg2(id,3,'before you die you respawn at the same point')
cod_msg2(id,3,'and will be able to kill others')
return 1
elseif words=='!hp' then
cod_msg2(id,3,'you will have extra hp')
return 1
elseif words=='!ammo' then
cod_msg2(id,3,'you can request extra ammo with F4')
return 1
elseif words=='!drop he' then
cod_msg2(id,3,'when you die you will drop a he which explodes')
return 1
elseif words=='!secondary mashine gun' then
cod_msg2(id,3,'you can choose an extra mashine gun instead of getting a pistol')
return 1
elseif words=='!extra damage' then
cod_msg2(id,3,'you will make more damage')
return 1
elseif words=='!hardliner' then
cod_msg2(id,3,'you will need 1 kill less for your streaks')
return 1
end
end
function cod_team(id,p)
if player(id,"bot") then
cod_xp[id]=math.random(1,281200)
give_xp(id,1)
else
end
cod_str_a[id] = 0
cod_jeta[id] = 0
cod_jet2a[id] = 0
cod_helia[id] = 0
cod_seny[id] = 0
cod_senx[id] = 0
cod_turret[id] = 0
cod_misslea[id] = 0
cod_missle[id] = 0
cod_ffkill[id] = 0
cod_harrier_strike[id] = 0
cod_uavkill[id] = 0
cod_slot[id] = 1
cod_extra_jet[id] = 0
cod_hardliner[id] = 0
cod_team_load(id)
cod_helpcline()
cod_hudinfo(id)
cod_info[id] = 1
cod_streakinfo[id] = 1
tiley[id] = 0
tilex[id] = 0
tileok[id] = 0
cod_heli_timer[id] = 0
cod_heli_timer2[id] = 0
cod_heli_attacked[id] = 0
cod_heli_attacked2[id] = 0
cod_lasts[id] = 0
cod_extg[id] = 0
cod_exr[id] = 0
cod_ammo[id] = 0
cod_lstand[id] = 0
cod_txt2(id,4,1,'Xp: ('..cod_xp[id]..'/'..cod_nxp[id]..')',110,75,0)
cod_txt2(id,2,1,'Level: '..cod_lvl[id]..'/'..cod_lvlm..'',110,60,0)
end
function cod_heal(id)
local p
for p = 1, 32 do
if player(p,"exists") then
if cod_jet[p]>=3 then
cod_jet[p] = cod_jet[p]-1
cod_air(p)
elseif cod_jet[p]>=1 then
cod_jet[p] = cod_jet[p]-1
cod_air2(p)
if cod_jet[p]==1 then
cod_jeta[p]=0
end
end
if cod_jet2[p]>=3 then
cod_jet2[p] = cod_jet2[p]-1
cod_harrier(p)
elseif cod_jet2[p]>=1 then
if cod_jet2[p]==1 then
cod_jet2a[p]=0
end
cod_jet2[p] = cod_jet2[p]-1
cod_harrier2(p)
end
if cod_nuket[p]>=1 then
cod_nuket[p]=cod_nuket[p]-1
if cod_nuket[p]==1 then
cod_nuke(p)
elseif cod_nuket[p]>=2 then
cod_snd("Cod mode snd/nuke.wav")
end
end
if cod_heli_timer[p]>=1 then
cod_heli_timer[p] = cod_heli_timer[p] - 1
if cod_heli_timer[p]==20 then
cod_heli_attacked[p] = 0
cod_helif(p) -- helif means heli fire
elseif cod_heli_timer[p]==17 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==14 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==11 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==8 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==5 then
cod_heli_attacked[p] = 0
cod_helif(p)
cod_helia[p]=0
end
end
if cod_heli_timer2[p]>=1 then
cod_heli_timer2[p] = cod_heli_timer2[p] - 1
if cod_heli_timer2[p]==20 then
cod_shelif(p)
elseif cod_heli_timer2[p]==17 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==14 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==11 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==8 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==5 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
cod_helia[p]=0
end
end
end
end
local i, health
for i = 1, 32 do
health = player(i,"health")
if (player(i,"exists")) then
parse("sethealth "..i.." "..(health + 5))
end
end
end
function cod_kill(killer,victim,weapon) -- This idear is from utsfx
give_xp(killer,10) -- i made a extra function for giving xp it is easyer (give_xp(id,xp given to player with id)
cod_level[victim]=0
level=cod_level[killer]
level=level+1
cod_level[killer]=level
cod_timer[killer]=os.clock()
-- REGULAR KILL
if (level==1) then
-- Single Kill! Nothing Special!
elseif (level==3) then
if cod_str_a[killer]==1 then
give_xp(killer,60)
cod_msg2(killer,4,'3 kill Streak!! You get extra Xp@C')
else
give_xp(killer,20)
cod_snd2(killer,'Cod mode snd/3kills.wav')
cod_msg2(killer,4,'3 kill Streak!! You get extra Xp@C')
end
elseif (level==4) then
if cod_str_a[killer]==1 then
give_xp(killer,120)
cod_msg2(killer,4,'4 kill Streak!! You get extra Xp@C')
else
give_xp(killer,40)
if cod_slot[killer]==1 then
if cod_s1_str4[killer]== 1 then
cod_equip(killer,76)
cod_snd2(killer,'Cod mode snd/25kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You can send a Care Package@C')
cod_msg2(killer,4,'Just throw the airstrike at the position for the package')
else
cod_snd2(killer,'Cod mode snd/10kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You use a Counter-UAV@C')
if player(killer,"bot") then
cod_drone(killer)
else
cod_uavkill[killer] = cod_uavkill[killer] + 1
end
end
elseif cod_slot[killer]==2 then
if cod_s2_str4[killer]== 1 then
cod_equip(killer,76)
cod_snd2(killer,'Cod mode snd/25kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You can send a Care Package@C')
cod_msg2(killer,4,'Just throw the airstrike at the position for the package')
else
cod_snd2(killer,'Cod mode snd/10kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You use a Counter-UAV@C')
if player(killer,"bot") then
cod_drone(killer)
else
cod_uavkill[killer] = cod_uavkill[killer] + 1
end
end
elseif cod_slot[killer]==3 then
if cod_s3_str4[killer]== 1 then
cod_equip(killer,76)
cod_snd2(killer,'Cod mode snd/25kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You can send a Care Package@C')
cod_msg2(killer,4,'Just throw the airstrike at the position for the package')
else
cod_snd2(killer,'Cod mode snd/10kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You use a Counter-UAV@C')
if player(killer,"bot") then
cod_drone(killer)
else
cod_uavkill[killer] = cod_uavkill[killer] + 1
end
end
end
end
elseif (level==6) then
if cod_str_a[killer]==1 then
give_xp(killer,210)
cod_msg2(killer,4,'6 kill Streak!! You get extra Xp@C')
else
give_xp(killer,70)
if cod_slot[killer]==1 then
if cod_s1_str6[killer]== 1 then
cod_snd2(killer,'Cod mode snd/40kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You have a Sentry Gun@C')
if player(killer,"bot") then
cod_seny[killer] = player(killer,"tiley")
cod_senx[killer] = player(killer,"tilex")
else
cod_turret[killer] = cod_turret[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/30kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You use a Predator Missile@C')
if player(killer,"bot") then
cod_misslea[killer] = 1
else
cod_missle[killer] = cod_missle[killer] + 1
end
end
elseif cod_slot[killer]==2 then
if cod_s2_str6[killer]== 1 then
cod_snd2(killer,'Cod mode snd/40kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You have a Sentry Gun@C')
if player(killer,"bot") then
cod_seny[killer] = player(killer,"tiley")
cod_senx[killer] = player(killer,"tilex")
else
cod_turret[killer] = cod_turret[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/30kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You use a Predator Missile@C')
if player(killer,"bot") then
cod_misslea[killer] = 1
else
cod_missle[killer] = cod_missle[killer] + 1
end
end
elseif cod_slot[killer]==3 then
if cod_s3_str6[killer]== 1 then
cod_snd2(killer,'Cod mode snd/40kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You have a Sentry Gun@C')
if player(killer,"bot") then
cod_seny[killer] = player(killer,"tiley")
cod_senx[killer] = player(killer,"tilex")
else
cod_turret[killer] = cod_turret[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/30kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You use a Predator Missile@C')
if player(killer,"bot") then
cod_misslea[killer] = 1
else
cod_missle[killer] = cod_missle[killer] + 1
end
end
end
end
elseif (level==9) then
if cod_str_a[killer]==1 then
give_xp(killer,300)
cod_msg2(killer,4,'9 kill Streak!! You get extra Xp@C')
else
give_xp(killer,100)
cod_snd2(killer,'Cod mode snd/5kills.wav')
cod_msg2(killer,4,'9 kill Streak!! You can send a Airstrike@C')
if player(killer,"bot") then --if player is bot he wouldnt send it manual so i had to make it auto
cod_jet[killer] = 3
else
cod_msg2(killer,1,'Press f4 to activate!')
cod_tkill[killer] = cod_tkill[killer] + 1
end
end
elseif (level==15) then
if cod_str_a[killer]==1 then
give_xp(killer,450)
cod_msg2(killer,4,'15 kill Streak!! You get extra Xp@C')
else
give_xp(killer,150)
if cod_slot[killer]==1 then
if cod_s1_str15[killer]== 1 then
cod_snd2(killer,'Cod mode snd/15kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Harrier Strike@C')
if player(killer,"bot") then
cod_jet2[killer] = 3
else
cod_harrier_strike[killer] = cod_harrier_strike[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/7kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_helistart(killer)
else
cod_fkill[killer] = cod_fkill[killer] + 1
end
end
elseif cod_slot[killer]==2 then
if cod_s2_str15[killer]== 1 then
cod_snd2(killer,'Cod mode snd/15kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Harrier Strike@C')
if player(killer,"bot") then
cod_jet2[killer] = 3
else
cod_harrier_strike[killer] = cod_harrier_strike[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/7kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_helistart(killer)
else
cod_fkill[killer] = cod_fkill[killer] + 1
end
end
elseif cod_slot[killer]==3 then
if cod_s3_str15[killer]== 1 then
cod_snd2(killer,'Cod mode snd/15kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Harrier Strike@C')
if player(killer,"bot") then
cod_jet2[killer] = 3
else
cod_harrier_strike[killer] = cod_harrier_strike[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/7kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_helistart(killer)
else
cod_fkill[killer] = cod_fkill[killer] + 1
end
end
end
end
elseif (level==18) then
if cod_str_a[killer]==1 then
give_xp(killer,600)
cod_msg2(killer,4,'18 kill Streak!! You get extra Xp@C')
else
give_xp(killer,200)
cod_snd2(killer,'Cod mode snd/20kills.wav')
cod_msg2(killer,4,'18 kill Streak!! You can send a strong heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_heli_attacked2[killer] = 0
cod_shelistart(killer)
else
cod_ffkill[killer] = cod_ffkill[killer] + 1
end
end
elseif (level==25) then
if cod_str_a[killer]==1 then
give_xp(killer,900)
cod_msg2(killer,4,'25 kill Streak!! You get extra Xp@C')
else
give_xp(killer,300)
cod_snd2(killer,'Cod mode snd/50kills.wav')
cod_msg2(killer,4,'25 kill Streak!! Tactical Nuke standing by@C')
if player(killer,"bot") then
cod_nuke(id)
else
cod_tactical_nuke[killer] = cod_tactical_nuke[killer] + 1
end
end
end
end
function cod_serveraction(id,action)
if action == 1 then
menu(id,'Set up your Slot:,Primary weapon,Secondary weapon,Extra Grenade,Extra1,Extra2,Streaks')
end
if action == 2 then
if cod_last_kill[id]==1 then -- this is a extra when player has last stand and want to die he can use F3 instead the menu
parse('sethealth '..id..' 0')
else
selectslotm(id)-- i made a extra function for the menu its easyer when beginning makeing the functions for menu
end
end
if action == 3 then
menu(id,'Send:,Airstrike|'..cod_tkill[id]..',Heli|'..cod_fkill[id]..',Counter UAV|'..cod_uavkill[id]..',Harrier Strike|'..cod_harrier_strike[id]..',Strong Heli|'..cod_ffkill[id]..',Predator Missle|'..cod_missle[id]..',Sentry Gun|'..cod_turret[id]..',Ammo|'..cod_ammo[id]..',Tactical Nuke|'..cod_tactical_nuke[id]..'')
end
end
function cod_menu(id,menu,sel)
if (menu == 'Send:') then
if sel==1 then
if cod_jeta[id]==0 then
if cod_tkill[id]>=1 then
cod_jet[id] = 3
cod_jeta[id] = 1
cod_tkill[id] = cod_tkill[id] - 1
cod_msg2(id,2,'Airstrike called!@C')
else
cod_msg2(id,4,'You cant send a Airstrike!!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==2 then
if cod_helia[id]==0 then
if cod_fkill[id]>=1 then
cod_heli_attacked[id] = 0
cod_helia[id]=1
cod_helistart(id)
cod_fkill[id] = cod_fkill[id] - 1
cod_msg2(id,2,'Heli comming!@C')
else
cod_msg2(id,4,'You cant send a heli!!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==3 then
if cod_uavkill[id]>=1 then
cod_uavkill[id] = cod_uavkill[id] - 1
cod_msg2(id,2,'Counter UAV active!@C')
cod_counteruava[id] = 200
else
cod_msg2(id,4,'You dont have a Counter UAV!@C')
end
elseif sel==4 then
if cod_jet2a[id]==0 then
if cod_harrier_strike[id]>=1 then
cod_jet2a[id]=1
cod_harrier_strike[id] = cod_harrier_strike[id] - 1
cod_msg2(id,2,'Harrier Strike called!@C')
cod_jet2[id] = 3
else
cod_msg2(id,4,'You dont have a Harrier Strike!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==5 then
if cod_helia[id]==0 then
if cod_ffkill[id]>=1 then
cod_helia[id] = 1
cod_heli_attacked[id] = 0
cod_heli_attacked2[id] = 0
cod_ffkill[id] = cod_ffkill[id] - 1
cod_msg2(id,2,'Heli called!@C')
cod_shelistart(id)
else
cod_msg2(id,4,'You dont have a Strong Heli!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==6 then
if cod_missle[id]>=1 then
cod_missle[id] = cod_missle[id] - 1
cod_msg2(id,2,'Predator Missle activ!@C')
cod_misslea[id] = 1
else
cod_msg2(id,4,'You dont have a Predator Missle!@C')
end
elseif sel==7 then
if cod_turret[id]>=1 then
cod_turret[id] = cod_turret[id] - 1
cod_msg2(id,2,'Sentry Gun activ!@C')
cod_seny[id] = player(id,"tiley")
cod_senx[id] = player(id,"tilex")
else
cod_msg2(id,4,'You dont have a Sentry Gun!@C')
end
elseif sel==8 then
if cod_ammo[id]==1 then
cod_ammo[id] = 0
if cod_slot[id]==1 then
cod_equip(id,cod_s1_w[id])
cod_equip(id,cod_s1_w2[id])
if cod_s1_e2[id]==49 or cod_s1_e2[id]==47 or cod_s1_e2[id]==96 then
cod_equip(id,cod_s1_e2[id])
end
elseif cod_slot[id]==2 then
cod_equip(id,cod_s2_w[id])
cod_equip(id,cod_s2_w2[id])
if cod_s2_e2[id]==49 or cod_s2_e2[id]==47 or cod_s2_e2[id]==96 then
cod_equip(id,cod_s2_e2[id])
end
elseif cod_slot[id]==3 then
cod_equip(id,cod_s3_w[id])
cod_equip(id,cod_s3_w2[id])
if cod_s3_e2[id]==49 or cod_s3_e2[id]==47 or cod_s3_e2[id]==96 then
cod_equip(id,cod_s3_e2[id])
end
end
else
cod_msg2(id,3,'Dont have this extra!!')
end
elseif sel==9 then
if cod_tactical_nuke[id]>=1 then
cod_tactical_nuke[id] = cod_tactical_nuke[id] - 1
cod_nuket[id] = 11
cod_msg2(id,2,'Nuke activ!@C')
else
cod_msg2(id,4,'You dont have a Tactical Nuke!!@C')
end
end
elseif (menu == 'Set up your Slot:') then
if sel==1 then
prit(id)
elseif sel==2 then
secw(id)
elseif sel==3 then
gres(id)
elseif sel==4 then
extra1(id)
elseif sel==5 then
extra2(id)
elseif sel==6 then
streaksm(id)
end
elseif (menu == 'Select your weapon Type:') then -- there were to many primary weapons so i desided to make a extra menu like in the buy menu
if sel==1 then
shotgunm(id)
elseif sel==2 then
Submgunm(id)
elseif sel==3 then
riflesm(id)
elseif sel==4 then
if cod_lvl[id]>=24 then
setweapon(id,1,40)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
prit(id)
end
end
elseif (menu == 'Select your secondary weapon:') then -- the pistols are orderd in the row when you get them
if sel==1 then -- first weapon is already free to use so no if cod_lvl[id]...
setweapon(id,2,1)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=3 then
setweapon(id,2,2)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==3 then
if cod_lvl[id]>=7 then
setweapon(id,2,4)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==4 then
if cod_lvl[id]>=12 then
setweapon(id,2,6)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==5 then
if cod_lvl[id]>=17 then
setweapon(id,2,5)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==6 then
if cod_lvl[id]>=21 then
setweapon(id,2,3)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
end
elseif (menu == 'Select your extra Grenade:') then
if sel==1 then
setweapon(id,3,51)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=8 then
setweapon(id,3,52)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Grenade!')
gres(id)
end
elseif sel==3 then
if cod_lvl[id]>=12 then
setweapon(id,3,53)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Grenade!')
gres(id)
end
end
elseif (menu == 'Select your first Extra:') then
if sel==1 then
setweapon(id,4,90)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=15 then
setweapon(id,4,54)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==3 then
if cod_lvl[id]>=18 then
setweapon(id,4,77)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==4 then
if cod_lvl[id]>=23 then
setweapon(id,4,92)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==5 then
if cod_lvl[id]>= 29 then
setweapon(id,4,93)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==6 then
if cod_lvl[id]>=32 then
setweapon(id,4,79)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==7 then
if cod_lvl[id]>=34 then
setweapon(id,4,99)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==8 then
if cod_lvl[id]>=36 then
setweapon(id,4,101)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
end
elseif (menu == 'Select your second Extra:') then
if sel==1 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,58)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=27 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,49)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==3 then
if cod_lvl[id]>=25 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,91)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==4 then
if cod_lvl[id]>=28 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,95)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==5 then
if cod_lvl[id]>=30 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,47)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==6 then
if cod_lvl[id]>=31 then
extrarifle(id)
cod_exr[id] = 1
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==7 then
if cod_lvl[id]>=32 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,94)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==8 then
if cod_lvl[id]>=7 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,96)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
end
elseif (menu == 'Select your shotgun:') then
if sel==1 then
setweapon(id,1,10)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=14 then
setweapon(id,1,11)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
shotgunm(id)
end
end
elseif (menu == 'Select your Sub maschine Gun:') then
if sel==1 then
setweapon(id,1,21)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=2 then
setweapon(id,1,23)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
elseif sel==3 then
if cod_lvl[id]>=4 then
setweapon(id,1,20)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
elseif sel==4 then
if cod_lvl[id]>=6 then
setweapon(id,1,24)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
elseif sel==5 then
if cod_lvl[id]>=10 then
setweapon(id,1,22)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
end
elseif (menu == 'Select your Rifle:') then
if sel==1 then
setweapon(id,1,35)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=5 then
setweapon(id,1,38)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==3 then
if cod_lvl[id]>=9 then
setweapon(id,1,37)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==4 then
if cod_lvl[id]>=11 then
setweapon(id,1,39)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==5 then
if cod_lvl[id]>=13 then
setweapon(id,1,30)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==6 then
if cod_lvl[id]>=16 then
setweapon(id,1,31)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==7 then
if cod_lvl[id]>=19 then
setweapon(id,1,34)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
riflesm(id)
end
elseif sel==8 then
if cod_lvl[id]>=20 then
setweapon(id,1,33)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==9 then
riflesm2(id)
end
elseif (menu == 'Select your Rifle2:') then
if sel==1 then
if cod_lvl[id]>=22 then
setweapon(id,1,36)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm2(id)
end
elseif sel==2 then
if cod_lvl[id]>=26 then
setweapon(id,1,32)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm2(id)
end
elseif sel==3 then
riflesm(id)
end
elseif (menu == 'Select your Slot:') then
if sel==1 then
cod_slot[id] = 1
elseif sel==2 then
cod_slot[id] = 2
elseif sel==3 then
cod_slot[id] = 3
elseif sel==4 then
cod_hudinfo(id)
elseif sel==5 then
adminhelpm(id)
end
elseif (menu == 'Select your secondary rifle:') then
if sel==1 then
setweapon(id,2,38)
elseif sel==2 then
setweapon(id,2,39)
elseif sel==3 then
setweapon(id,2,30)
elseif sel==4 then
setweapon(id,2,31)
elseif sel==5 then
setweapon(id,2,33)
elseif sel==6 then
setweapon(id,2,32)
end
elseif (menu == 'Streaks:') then
if sel==1 then
fkillsm(id)
elseif sel==2 then
skillsm(id)
elseif sel==3 then
ftkillsm(id)
elseif sel==4 then
if cod_str_a[id]==0 then
cod_str_a[id] = 1
else
cod_str_a[id] = 0
end
end
elseif (menu =='4 Kills:') then
if sel==1 then
setstreak(id,1,1)
elseif sel==2 then
setstreak(id,1,2)
end
elseif (menu =='6 Kills:') then
if sel==1 then
setstreak(id,2,1)
elseif sel==2 then
setstreak(id,2,2)
end
elseif (menu =='15 Kills:') then
if sel==1 then
setstreak(id,3,1)
elseif sel==2 then
setstreak(id,3,2)
end
end
end
function cod_parse(cmd)
if (cmd == cod_commands[1]) then
cod_print(2,'====== Console Commands List ======')
for i = 1,5 do
cod_print(2,cod_commands[i]..''..cod_commands_inf[i])
end
return 2
end
if (cmd == cod_commands[2]) then
cod_print(2,'====== Say Commands List ======')
for i = 1,1 do
cod_print(2,'!help for information')
cod_print(2,'rank for your ranking')
end
return 2
end
if (cmd == cod_commands[3]) then
cod_print(2,'====== Players List ======')
for i = 1,pl_count do
if (player(i,"exists")) then
if (player(i,"health") > 0) then
cod_print(2,player(i,"name").." - Level: "..cod_lvl[i].." - Experience: ("..cod_xp[i].."/"..cod_nxp[i]..")")
else
cod_print(4,player(i,"name").." (dead) - Level: "..cod_lvl[i].." - Experience: ("..cod_xp[i].."/"..cod_nxp[i]..")")
end
end
end
return 2
end
if (string.sub(cmd, 1, == cod_commands[4]) then
local parses = totable(cmd)
local pl = tonumber(parses[2])
local xp = tonumber(parses[3])
if (pl ~= nil) and (xp ~= nil) then
if (player(pl,"exists")) then
cod_print(2,'You Gave '..xp..' xp for '..player(pl,"name")..'!')
cod_msg2(pl,2,'You got '..xp..' from Admin!@C')
give_xp(pl,xp)
else
cod_print(4,'This player does not exist!')
end
else
cod_print(4,'The player or the xp is wrong!')
end
return 2
end
if (string.sub(cmd, 1, == cod_commands[5]) then
local parses = totable(cmd)
local i = tonumber(parses[2])
local st = tonumber(parses[3])
local am = tonumber(parses[4])
if (i~=nil) and (st~=nil) and (am ~= nil) then
if (player(i,"exists")) then
if st==1 then
cod_tkil
-- Call of Duty mode by Loooser --
----------------------------------------------------------------
----------------------------------------------------------------
-- my weapons: --
----------------------------------------------------------------
--weapon id | weapon name | needed lvl | Extra weapon description
-- 1 USP -
-- 56 Defuse Kit -
-- 10 M3 -
-- 21 TMP -
-- 35 AWP -
-- 51 HE -
-- 90 Run Faster - You will run faster
-- 58 Kevlar + Helm -
-- 23 Mac 10 2
-- 2 Glock 3
-- 20 MP5 4
-- 38 Galil 5
-- 24 UMP45 6
-- 4 P228 7
-- 97 C4 7 you get 2 c4 packs (not finished jet)
-- 52 Flashbang 8
-- 37 SG550 9
-- 22 P90 10
-- 39 Famas 11
-- 53 Smoke Grenade 12
-- 6 Five-Seven 12
-- 30 AK-47 13
-- 11 XM1014 14
-- 54 Flare 15
-- 31 SG552 16
-- 5 Elite 17
-- 95 Faster Heal 17 You heal yourself faster (not finished jet)
-- 77 Mine 18
-- 34 Scout 19
-- 33 Aug 20
-- 3 Deagle 21
-- 36 G3SG1 22
-- 92 Last Stand 23 when die you will lie on ground and fire
-- 40 M249 24
-- 91 Hp 25 You get extra hp
-- 32 M4A1 26
-- 49 Grenade Launcher27
-- 95 Extra Ammo 28 You have extra ammo
-- 93 Drop He 29 when die you will drop a he
-- 89 RPG 30
-- 96 Secondary mashine Gun 31 You can have a mashine gun instead a pistol
-- 79 Light Armor 32
-- 94 More Damage X 33 You will make more damage
-- 99 Hardliner 34 you need 1 kill less for the killing streaks
-- 100 ammo thief 35 you can pick up ammo from weapons of ground (not finished jet)
-- 101 extra jet 36 you get a jet on spawn
-- 102 care package 37 you get he , ammo , hp
----------------------------------------------------------------
-- server settings --
----------------------------------------------------------------
if game("mp_damagefactor")~=1.5 then -- damage has to be 1.5 !!
parse('mp_damagefactor 1.5')
end
parse('sv_friendlyfire 0')
parse('mp_infammo 0') -- with inf ammo my Item Extra Ammo would be nothing !!
parse('mp_killinfo 0') -- there would be to many msg
parse('mp_autoteambalance 1') -- we need a fair game !!
if sample==nil then sample={} end
sample.ut={}
----------------------------------------------------------------
-- Vaules --
----------------------------------------------------------------
function array(m)
local array = {}
for i = 1, m do
array[i] = 0
end
return array
end
--Game Settings---------------------------------------------
cod_commands = {'cod_commands','cod_say','cod_players','cod_gpxp','cod_gpst'}
cod_commands_inf = {' - Console Commands',' - Say Commands List',' - Players List',' - Give player xp <id> <xp>',' - Give player streak <id> <streak> <amount>'}
color = {'©255200000','©000255000','©160160255','©255000000','©240000240','©255128064','©000000000'}
cod_mapx = map("xsize")
cod_mapy = map("ysize")
pl_count = game('sv_maxplayers')
cod_1_set = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
wpn_names = {'USP','Glock','Deagle','P228','Elite','Five-seven','-','-','-','M3','XM1014','-','-','-','-','-','-','-','-','MP5','TMP','P90','Mac 10','UMP45','-','-','-','-','-','AK-47','SG552','M4A1','Aug','Scout','AWP','G3SG1','SG550','Galil','Famas','M249'}
cod_nxp_ratio = 20
bestplayer = 'no'
cod_lvlm = 37
cod_info_lines = 0
cod_streak_lines = 0
cod_timer = array(32)
cod_level = array(32)
cod_fblood = 0
cod_info_lines = {}
cod_fpl32 = 0
--Player Information----------------------------------------
--Streak Vaules
cod_str_a = array(pl_count)
cod_jeta = array(pl_count)
cod_jet2a = array(pl_count)
cod_helia = array(pl_count)
cod_jet_save = array(pl_count)
cod_jet2_save = array(pl_count)
cod_jet = array(pl_count)
cod_jet2 = array(pl_count)
cod_turret = array(pl_count)
cod_harrier_strike = array(pl_count)
cod_tactical_nuke = array(pl_count)
cod_missle = array(pl_count)
cod_misslea = array(pl_count)
cod_extra_jet = array(pl_count)
cod_uavkill = array(pl_count)
cod_heli_attacked = array(pl_count)
cod_heli_attacked2 = array(pl_count)
cod_counteruava = array(pl_count)
cod_heli_life = array(pl_count)
cod_heli_timer = array(pl_count)
cod_heli_timer2 = array(pl_count)
cod_tkill = array(pl_count)
cod_fkill = array(pl_count)
cod_ffkill = array(pl_count)
cod_nuket = array(pl_count)
--Xp Vaules
cod_xp = array(pl_count)
cod_nxp = array(pl_count)
cod_lvl = array(pl_count)
--Slot Vaules
cod_slot = array(pl_count)
--slot1
cod_s1_w = array(pl_count)
cod_s1_w2 = array(pl_count)
cod_s1_e = array(pl_count)
cod_s1_e2 = array(pl_count)
cod_s1_g = array(pl_count)
cod_s1_wn = array(pl_count)
cod_s1_w2n = array(pl_count)
cod_s1_str4 = array(pl_count)
cod_s1_str6 = array(pl_count)
cod_s1_str15 = array(pl_count)
--slot2
cod_s2_w = array(pl_count)
cod_s2_w2 = array(pl_count)
cod_s2_e = array(pl_count)
cod_s2_e2 = array(pl_count)
cod_s2_g = array(pl_count)
cod_s2_wn = array(pl_count)
cod_s2_w2n = array(pl_count)
cod_s2_str4 = array(pl_count)
cod_s2_str6 = array(pl_count)
cod_s2_str15 = array(pl_count)
--slot3
cod_s3_w = array(pl_count)
cod_s3_w2 = array(pl_count)
cod_s3_e = array(pl_count)
cod_s3_e2 = array(pl_count)
cod_s3_g = array(pl_count)
cod_s3_wn = array(pl_count)
cod_s3_w2n = array(pl_count)
cod_s3_str4 = array(pl_count)
cod_s3_str6 = array(pl_count)
cod_s3_str15 = array(pl_count)
--extra vaules
cod_ammo = array(pl_count)
cod_lstand = array(pl_count)
cod_exr = array(pl_count)
cod_extg = array(pl_count)
cod_lasts = array(pl_count)
cod_last_kill = array(pl_count)
tiley = array(pl_count)
tilex = array(pl_count)
cod_extrad = array(pl_count)
tileok = array(pl_count)
cod_hardliner = array(pl_count)
--other
cod_senx = array(pl_count)
cod_seny = array(pl_count)
cod_info = array(pl_count)
cod_streakinfo = array(pl_count)
--building
cod_pl_x = array(pl_count)
cod_pl_y = array(pl_count)
cod_b_mo = array(pl_count)
cod_pl_w = array(pl_count)
cod_b_t = array(pl_count)
----------------------------------------------------------------
-- ADDHOOKS --
----------------------------------------------------------------
addhook("second","cod_heal")
addhook("kill","cod_kill")
addhook("say","cod_say")
addhook("team","cod_team")
addhook("spawn","cod_spawn")
addhook("menu","cod_menu")
addhook("serveraction","cod_serveraction")
addhook("die","cod_die")
addhook("leave","cod_leave")
addhook("minute","cod_min")
addhook("dominate","cod_dominate")
addhook("bombplant","cod_bombplant")
addhook("bombdefuse","cod_bombdefuse")
addhook("parse","cod_parse")
addhook("hit","cod_hit")
addhook("ms100","cod_ms100")
addhook("walkover","cod_walkover")
addhook("drop","cod_drop")
addhook("buy","cod_buy")
addhook("projectile","cod_projectile")
addhook("mapchange","cod_mapchange")
addhook("join","cod_join")
addhook("startround","cod_startround")
addhook("movetile","cod_movetile")
addhook("always","cod_always")
addhook("objectdamage","cod_objectdamage")
----------------------------------------------------------------
-- FUNCTIONS WITH HOOKS --
----------------------------------------------------------------
function cod_objectdamage(id,damage,player)
if player==object(id,"player") then
if cod_pl_w[player]==50 then
if object(id,"type")==8 then
cod_b_t[player] = object(id,"type")
parse("killobject "..id)
cod_b_mo[player] = 1
return 1
end
end
end
end
function cod_always()
for i = 1, 32 do
cod_pl_w[i] = player(i,"weapontype")
end
end
function cod_movetile(id,x,y)
if cod_seny[id]~=0 and cod_senx[id]~=0 then
parse("spawnobject 8 "..cod_senx[id].." "..cod_seny[id].." 1 1 "..player(id,"team").." "..id)
cod_seny[id] = 0
cod_senx[id] = 0
end
if cod_b_mo[id]==1 then
cod_b_mo[id] = 0
parse("spawnobject "..cod_b_t[id].." "..cod_pl_x[id].." "..cod_pl_y[id].." 0 0 "..player(id,"team").." "..id)
end
cod_pl_x[id] = player(id,"x")/32
cod_pl_y[id] = player(id,"y")/32
end
function cod_startround()
for p = 1, 32 do
cod_tactical_nuke[p] = 0
cod_tkill[p] = 0
cod_fkill[p] = 0
cod_uavkill[p] = 0
cod_harrier_strike[p] = 0
cod_ffkill[p] = 0
cod_missle[p] = 0
cod_turret[p] = 0
end
end
function cod_mapchange()
cod_mapx = map("xsize")
cod_mapy = map("ysize")
end
function cod_projectile(id,weapon,x,y)
if weapon==54 then
tiley[id] = y
tilex[id] = x
tileok[id] = 1
elseif weapon==76 then
local xx = x / 32
local yy = y / 32
parse("spawnitem 65 "..xx.." "..yy.."")
parse("spawnitem 61 "..xx.." "..yy.."")
parse("spawnitem 62 "..xx.." "..yy.."")
return 1
end
end
function cod_buy(id)
cod_msg2(id,4,"Buying Disabled!@C")
return 1
end
function cod_drop(id,iid,type)
if type<55 and type>46 then
return 1
end
end
function cod_walkover(id,iid,type)
if type<55 and type>46 then
return 1
end
end
function cod_ms100()
for p = 1, 32 do
if player(p,"exists") then
if cod_counteruava[p]>=1 then
cod_counteruava[p]=cod_counteruava[p]-1
cod_drone(p)
end
end
end
end
function cod_hit(id,s,h,wpn)
if cod_misslea[s]==1 then
cod_misslea[s] = 0
local a = player(id,"x")
local b = player(id,"y")
cod_predator(s,a,b,id)
end
if player(s,"exists") then
if cod_extrad[s]==1 then
local dmg = h + (h*0.75)
if player(id,"health") - dmg > 0 then
parse('sethealth '..id..' ' ..player(id,"health") - dmg)
return 1
else
end
end
if player(id,"health") - h <= 0 then
if cod_lasts[id]==1 then
cod_last_kill[id] = 1
cod_lasts[id] = 0
cod_msg2(id,4,'Last stand!!@C')
cod_msg2(id,3,'Press F3 to die!!@C')
cod_speed(id,-100)
parse('sethealth '..id..' 100')
return 1
end
end
end
end
function cod_bombdefuse(id)
cod_msg2(id,4,'You get extra Xp for Bombdefusing!!')
give_xp(id,100)
end
function cod_bombplant(id)
cod_msg2(id,4,'You get extra Xp for Bombplanting!!')
give_xp(id,50)
end
function cod_dominate(id)
cod_msg2(id,4,'You get extra Xp for dominating!!')
give_xp(id,50)
end
function cod_min()
if cod_fpl32==1 then
cod_msg(4,'The first Player who reached Level '..cod_lvlm..' is '..bestplayer)
end
end
function cod_leave(id)
cod_1_set[id] = 1
cod_leave_save(id)
end
function cod_die(victim)
if cod_lstand[victim]==1 then
local x = player(victim,"x")
local y = player(victim,"y")
cod_explosion(victim,150,x,y)
end
end
function cod_spawn(id)
parse("strip "..id)
if cod_extra_jet[id]==1 then
cod_extra_jet[id] = 0
cod_tkill[id] = cod_tkill[id] + 1
end
if cod_hardliner[id]==1 then
cod_hardliner[id] = 0
cod_level[id] = 1
end
cod_spawnflare(id)
cod_last_kill[id] = 0
cod_extrad[id] = 0
if player(id,"bot") then
else
cod_equip(id,51)
end
if cod_slot[id]==1 then
cod_equip(id,cod_s1_w[id])
cod_equip(id,cod_s1_w2[id])
cod_equip(id,cod_s1_e[id])
if player(id,"bot") then
else
cod_equip(id,cod_s1_g[id])
end
cod_equip(id,cod_s1_e2[id])
elseif cod_slot[id]==2 then
cod_equip(id,cod_s2_w[id])
cod_equip(id,cod_s2_w2[id])
cod_equip(id,cod_s2_e[id])
cod_equip(id,cod_s2_e2[id])
if player(id,"bot") then
else
cod_equip(id,cod_s2_g[id])
end
elseif cod_slot[id]==3 then
cod_equip(id,cod_s3_w[id])
cod_equip(id,cod_s3_w2[id])
cod_equip(id,cod_s3_e[id])
cod_equip(id,cod_s3_e2[id])
if player(id,"bot") then
else
cod_equip(id,cod_s3_g[id])
end
end
end
function cod_say(id,words)
if words=='!help' then
cod_msg2(id,3,'Help Info:')
cod_msg2(id,3,'Press f4 to send a airstrike or heli')
cod_msg2(id,3,'Press f2 to set up your slot with your new weapons')
elseif words=='rank' or words=='Rank' or words=='RAnk' or words=='RANk' or words=='RANK' or words=='ranK' or words=='raNK' or words=='rANK' then
cod_msg(6,player(id,"name")..' is on rank:')
cod_msg(6,'Level: '..cod_lvl[id]..', Expierience: ('..cod_xp[id]..'|'..cod_nxp[id]..').')
elseif words=='!run faster' then
cod_msg2(id,3,'You will run a bit faster')
return 1
elseif words=='!last stand' then
cod_msg2(id,3,'before you die you respawn at the same point')
cod_msg2(id,3,'and will be able to kill others')
return 1
elseif words=='!hp' then
cod_msg2(id,3,'you will have extra hp')
return 1
elseif words=='!ammo' then
cod_msg2(id,3,'you can request extra ammo with F4')
return 1
elseif words=='!drop he' then
cod_msg2(id,3,'when you die you will drop a he which explodes')
return 1
elseif words=='!secondary mashine gun' then
cod_msg2(id,3,'you can choose an extra mashine gun instead of getting a pistol')
return 1
elseif words=='!extra damage' then
cod_msg2(id,3,'you will make more damage')
return 1
elseif words=='!hardliner' then
cod_msg2(id,3,'you will need 1 kill less for your streaks')
return 1
end
end
function cod_team(id,p)
if player(id,"bot") then
cod_xp[id]=math.random(1,281200)
give_xp(id,1)
else
end
cod_str_a[id] = 0
cod_jeta[id] = 0
cod_jet2a[id] = 0
cod_helia[id] = 0
cod_seny[id] = 0
cod_senx[id] = 0
cod_turret[id] = 0
cod_misslea[id] = 0
cod_missle[id] = 0
cod_ffkill[id] = 0
cod_harrier_strike[id] = 0
cod_uavkill[id] = 0
cod_slot[id] = 1
cod_extra_jet[id] = 0
cod_hardliner[id] = 0
cod_team_load(id)
cod_helpcline()
cod_hudinfo(id)
cod_info[id] = 1
cod_streakinfo[id] = 1
tiley[id] = 0
tilex[id] = 0
tileok[id] = 0
cod_heli_timer[id] = 0
cod_heli_timer2[id] = 0
cod_heli_attacked[id] = 0
cod_heli_attacked2[id] = 0
cod_lasts[id] = 0
cod_extg[id] = 0
cod_exr[id] = 0
cod_ammo[id] = 0
cod_lstand[id] = 0
cod_txt2(id,4,1,'Xp: ('..cod_xp[id]..'/'..cod_nxp[id]..')',110,75,0)
cod_txt2(id,2,1,'Level: '..cod_lvl[id]..'/'..cod_lvlm..'',110,60,0)
end
function cod_heal(id)
local p
for p = 1, 32 do
if player(p,"exists") then
if cod_jet[p]>=3 then
cod_jet[p] = cod_jet[p]-1
cod_air(p)
elseif cod_jet[p]>=1 then
cod_jet[p] = cod_jet[p]-1
cod_air2(p)
if cod_jet[p]==1 then
cod_jeta[p]=0
end
end
if cod_jet2[p]>=3 then
cod_jet2[p] = cod_jet2[p]-1
cod_harrier(p)
elseif cod_jet2[p]>=1 then
if cod_jet2[p]==1 then
cod_jet2a[p]=0
end
cod_jet2[p] = cod_jet2[p]-1
cod_harrier2(p)
end
if cod_nuket[p]>=1 then
cod_nuket[p]=cod_nuket[p]-1
if cod_nuket[p]==1 then
cod_nuke(p)
elseif cod_nuket[p]>=2 then
cod_snd("Cod mode snd/nuke.wav")
end
end
if cod_heli_timer[p]>=1 then
cod_heli_timer[p] = cod_heli_timer[p] - 1
if cod_heli_timer[p]==20 then
cod_heli_attacked[p] = 0
cod_helif(p) -- helif means heli fire
elseif cod_heli_timer[p]==17 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==14 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==11 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==8 then
cod_heli_attacked[p] = 0
cod_helif(p)
elseif cod_heli_timer[p]==5 then
cod_heli_attacked[p] = 0
cod_helif(p)
cod_helia[p]=0
end
end
if cod_heli_timer2[p]>=1 then
cod_heli_timer2[p] = cod_heli_timer2[p] - 1
if cod_heli_timer2[p]==20 then
cod_shelif(p)
elseif cod_heli_timer2[p]==17 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==14 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==11 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==8 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
elseif cod_heli_timer2[p]==5 then
cod_heli_attacked[p] = 0
cod_heli_attacked2[p] = 0
cod_shelif(p)
cod_helia[p]=0
end
end
end
end
local i, health
for i = 1, 32 do
health = player(i,"health")
if (player(i,"exists")) then
parse("sethealth "..i.." "..(health + 5))
end
end
end
function cod_kill(killer,victim,weapon) -- This idear is from utsfx
give_xp(killer,10) -- i made a extra function for giving xp it is easyer (give_xp(id,xp given to player with id)
cod_level[victim]=0
level=cod_level[killer]
level=level+1
cod_level[killer]=level
cod_timer[killer]=os.clock()
-- REGULAR KILL
if (level==1) then
-- Single Kill! Nothing Special!
elseif (level==3) then
if cod_str_a[killer]==1 then
give_xp(killer,60)
cod_msg2(killer,4,'3 kill Streak!! You get extra Xp@C')
else
give_xp(killer,20)
cod_snd2(killer,'Cod mode snd/3kills.wav')
cod_msg2(killer,4,'3 kill Streak!! You get extra Xp@C')
end
elseif (level==4) then
if cod_str_a[killer]==1 then
give_xp(killer,120)
cod_msg2(killer,4,'4 kill Streak!! You get extra Xp@C')
else
give_xp(killer,40)
if cod_slot[killer]==1 then
if cod_s1_str4[killer]== 1 then
cod_equip(killer,76)
cod_snd2(killer,'Cod mode snd/25kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You can send a Care Package@C')
cod_msg2(killer,4,'Just throw the airstrike at the position for the package')
else
cod_snd2(killer,'Cod mode snd/10kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You use a Counter-UAV@C')
if player(killer,"bot") then
cod_drone(killer)
else
cod_uavkill[killer] = cod_uavkill[killer] + 1
end
end
elseif cod_slot[killer]==2 then
if cod_s2_str4[killer]== 1 then
cod_equip(killer,76)
cod_snd2(killer,'Cod mode snd/25kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You can send a Care Package@C')
cod_msg2(killer,4,'Just throw the airstrike at the position for the package')
else
cod_snd2(killer,'Cod mode snd/10kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You use a Counter-UAV@C')
if player(killer,"bot") then
cod_drone(killer)
else
cod_uavkill[killer] = cod_uavkill[killer] + 1
end
end
elseif cod_slot[killer]==3 then
if cod_s3_str4[killer]== 1 then
cod_equip(killer,76)
cod_snd2(killer,'Cod mode snd/25kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You can send a Care Package@C')
cod_msg2(killer,4,'Just throw the airstrike at the position for the package')
else
cod_snd2(killer,'Cod mode snd/10kills.wav')
cod_msg2(killer,4,'4 kill Streak!! You use a Counter-UAV@C')
if player(killer,"bot") then
cod_drone(killer)
else
cod_uavkill[killer] = cod_uavkill[killer] + 1
end
end
end
end
elseif (level==6) then
if cod_str_a[killer]==1 then
give_xp(killer,210)
cod_msg2(killer,4,'6 kill Streak!! You get extra Xp@C')
else
give_xp(killer,70)
if cod_slot[killer]==1 then
if cod_s1_str6[killer]== 1 then
cod_snd2(killer,'Cod mode snd/40kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You have a Sentry Gun@C')
if player(killer,"bot") then
cod_seny[killer] = player(killer,"tiley")
cod_senx[killer] = player(killer,"tilex")
else
cod_turret[killer] = cod_turret[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/30kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You use a Predator Missile@C')
if player(killer,"bot") then
cod_misslea[killer] = 1
else
cod_missle[killer] = cod_missle[killer] + 1
end
end
elseif cod_slot[killer]==2 then
if cod_s2_str6[killer]== 1 then
cod_snd2(killer,'Cod mode snd/40kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You have a Sentry Gun@C')
if player(killer,"bot") then
cod_seny[killer] = player(killer,"tiley")
cod_senx[killer] = player(killer,"tilex")
else
cod_turret[killer] = cod_turret[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/30kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You use a Predator Missile@C')
if player(killer,"bot") then
cod_misslea[killer] = 1
else
cod_missle[killer] = cod_missle[killer] + 1
end
end
elseif cod_slot[killer]==3 then
if cod_s3_str6[killer]== 1 then
cod_snd2(killer,'Cod mode snd/40kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You have a Sentry Gun@C')
if player(killer,"bot") then
cod_seny[killer] = player(killer,"tiley")
cod_senx[killer] = player(killer,"tilex")
else
cod_turret[killer] = cod_turret[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/30kills.wav')
cod_msg2(killer,4,'6 kill Streak!! You use a Predator Missile@C')
if player(killer,"bot") then
cod_misslea[killer] = 1
else
cod_missle[killer] = cod_missle[killer] + 1
end
end
end
end
elseif (level==9) then
if cod_str_a[killer]==1 then
give_xp(killer,300)
cod_msg2(killer,4,'9 kill Streak!! You get extra Xp@C')
else
give_xp(killer,100)
cod_snd2(killer,'Cod mode snd/5kills.wav')
cod_msg2(killer,4,'9 kill Streak!! You can send a Airstrike@C')
if player(killer,"bot") then --if player is bot he wouldnt send it manual so i had to make it auto
cod_jet[killer] = 3
else
cod_msg2(killer,1,'Press f4 to activate!')
cod_tkill[killer] = cod_tkill[killer] + 1
end
end
elseif (level==15) then
if cod_str_a[killer]==1 then
give_xp(killer,450)
cod_msg2(killer,4,'15 kill Streak!! You get extra Xp@C')
else
give_xp(killer,150)
if cod_slot[killer]==1 then
if cod_s1_str15[killer]== 1 then
cod_snd2(killer,'Cod mode snd/15kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Harrier Strike@C')
if player(killer,"bot") then
cod_jet2[killer] = 3
else
cod_harrier_strike[killer] = cod_harrier_strike[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/7kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_helistart(killer)
else
cod_fkill[killer] = cod_fkill[killer] + 1
end
end
elseif cod_slot[killer]==2 then
if cod_s2_str15[killer]== 1 then
cod_snd2(killer,'Cod mode snd/15kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Harrier Strike@C')
if player(killer,"bot") then
cod_jet2[killer] = 3
else
cod_harrier_strike[killer] = cod_harrier_strike[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/7kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_helistart(killer)
else
cod_fkill[killer] = cod_fkill[killer] + 1
end
end
elseif cod_slot[killer]==3 then
if cod_s3_str15[killer]== 1 then
cod_snd2(killer,'Cod mode snd/15kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Harrier Strike@C')
if player(killer,"bot") then
cod_jet2[killer] = 3
else
cod_harrier_strike[killer] = cod_harrier_strike[killer] + 1
end
else
cod_snd2(killer,'Cod mode snd/7kills.wav')
cod_msg2(killer,4,'15 kill Streak!! You can send a Heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_helistart(killer)
else
cod_fkill[killer] = cod_fkill[killer] + 1
end
end
end
end
elseif (level==18) then
if cod_str_a[killer]==1 then
give_xp(killer,600)
cod_msg2(killer,4,'18 kill Streak!! You get extra Xp@C')
else
give_xp(killer,200)
cod_snd2(killer,'Cod mode snd/20kills.wav')
cod_msg2(killer,4,'18 kill Streak!! You can send a strong heli@C')
if player(killer,"bot") then
cod_heli_attacked[killer] = 0
cod_heli_attacked2[killer] = 0
cod_shelistart(killer)
else
cod_ffkill[killer] = cod_ffkill[killer] + 1
end
end
elseif (level==25) then
if cod_str_a[killer]==1 then
give_xp(killer,900)
cod_msg2(killer,4,'25 kill Streak!! You get extra Xp@C')
else
give_xp(killer,300)
cod_snd2(killer,'Cod mode snd/50kills.wav')
cod_msg2(killer,4,'25 kill Streak!! Tactical Nuke standing by@C')
if player(killer,"bot") then
cod_nuke(id)
else
cod_tactical_nuke[killer] = cod_tactical_nuke[killer] + 1
end
end
end
end
function cod_serveraction(id,action)
if action == 1 then
menu(id,'Set up your Slot:,Primary weapon,Secondary weapon,Extra Grenade,Extra1,Extra2,Streaks')
end
if action == 2 then
if cod_last_kill[id]==1 then -- this is a extra when player has last stand and want to die he can use F3 instead the menu
parse('sethealth '..id..' 0')
else
selectslotm(id)-- i made a extra function for the menu its easyer when beginning makeing the functions for menu
end
end
if action == 3 then
menu(id,'Send:,Airstrike|'..cod_tkill[id]..',Heli|'..cod_fkill[id]..',Counter UAV|'..cod_uavkill[id]..',Harrier Strike|'..cod_harrier_strike[id]..',Strong Heli|'..cod_ffkill[id]..',Predator Missle|'..cod_missle[id]..',Sentry Gun|'..cod_turret[id]..',Ammo|'..cod_ammo[id]..',Tactical Nuke|'..cod_tactical_nuke[id]..'')
end
end
function cod_menu(id,menu,sel)
if (menu == 'Send:') then
if sel==1 then
if cod_jeta[id]==0 then
if cod_tkill[id]>=1 then
cod_jet[id] = 3
cod_jeta[id] = 1
cod_tkill[id] = cod_tkill[id] - 1
cod_msg2(id,2,'Airstrike called!@C')
else
cod_msg2(id,4,'You cant send a Airstrike!!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==2 then
if cod_helia[id]==0 then
if cod_fkill[id]>=1 then
cod_heli_attacked[id] = 0
cod_helia[id]=1
cod_helistart(id)
cod_fkill[id] = cod_fkill[id] - 1
cod_msg2(id,2,'Heli comming!@C')
else
cod_msg2(id,4,'You cant send a heli!!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==3 then
if cod_uavkill[id]>=1 then
cod_uavkill[id] = cod_uavkill[id] - 1
cod_msg2(id,2,'Counter UAV active!@C')
cod_counteruava[id] = 200
else
cod_msg2(id,4,'You dont have a Counter UAV!@C')
end
elseif sel==4 then
if cod_jet2a[id]==0 then
if cod_harrier_strike[id]>=1 then
cod_jet2a[id]=1
cod_harrier_strike[id] = cod_harrier_strike[id] - 1
cod_msg2(id,2,'Harrier Strike called!@C')
cod_jet2[id] = 3
else
cod_msg2(id,4,'You dont have a Harrier Strike!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==5 then
if cod_helia[id]==0 then
if cod_ffkill[id]>=1 then
cod_helia[id] = 1
cod_heli_attacked[id] = 0
cod_heli_attacked2[id] = 0
cod_ffkill[id] = cod_ffkill[id] - 1
cod_msg2(id,2,'Heli called!@C')
cod_shelistart(id)
else
cod_msg2(id,4,'You dont have a Strong Heli!@C')
end
else
cod_msg2(id,4,'You have to wait!!@C')
end
elseif sel==6 then
if cod_missle[id]>=1 then
cod_missle[id] = cod_missle[id] - 1
cod_msg2(id,2,'Predator Missle activ!@C')
cod_misslea[id] = 1
else
cod_msg2(id,4,'You dont have a Predator Missle!@C')
end
elseif sel==7 then
if cod_turret[id]>=1 then
cod_turret[id] = cod_turret[id] - 1
cod_msg2(id,2,'Sentry Gun activ!@C')
cod_seny[id] = player(id,"tiley")
cod_senx[id] = player(id,"tilex")
else
cod_msg2(id,4,'You dont have a Sentry Gun!@C')
end
elseif sel==8 then
if cod_ammo[id]==1 then
cod_ammo[id] = 0
if cod_slot[id]==1 then
cod_equip(id,cod_s1_w[id])
cod_equip(id,cod_s1_w2[id])
if cod_s1_e2[id]==49 or cod_s1_e2[id]==47 or cod_s1_e2[id]==96 then
cod_equip(id,cod_s1_e2[id])
end
elseif cod_slot[id]==2 then
cod_equip(id,cod_s2_w[id])
cod_equip(id,cod_s2_w2[id])
if cod_s2_e2[id]==49 or cod_s2_e2[id]==47 or cod_s2_e2[id]==96 then
cod_equip(id,cod_s2_e2[id])
end
elseif cod_slot[id]==3 then
cod_equip(id,cod_s3_w[id])
cod_equip(id,cod_s3_w2[id])
if cod_s3_e2[id]==49 or cod_s3_e2[id]==47 or cod_s3_e2[id]==96 then
cod_equip(id,cod_s3_e2[id])
end
end
else
cod_msg2(id,3,'Dont have this extra!!')
end
elseif sel==9 then
if cod_tactical_nuke[id]>=1 then
cod_tactical_nuke[id] = cod_tactical_nuke[id] - 1
cod_nuket[id] = 11
cod_msg2(id,2,'Nuke activ!@C')
else
cod_msg2(id,4,'You dont have a Tactical Nuke!!@C')
end
end
elseif (menu == 'Set up your Slot:') then
if sel==1 then
prit(id)
elseif sel==2 then
secw(id)
elseif sel==3 then
gres(id)
elseif sel==4 then
extra1(id)
elseif sel==5 then
extra2(id)
elseif sel==6 then
streaksm(id)
end
elseif (menu == 'Select your weapon Type:') then -- there were to many primary weapons so i desided to make a extra menu like in the buy menu
if sel==1 then
shotgunm(id)
elseif sel==2 then
Submgunm(id)
elseif sel==3 then
riflesm(id)
elseif sel==4 then
if cod_lvl[id]>=24 then
setweapon(id,1,40)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
prit(id)
end
end
elseif (menu == 'Select your secondary weapon:') then -- the pistols are orderd in the row when you get them
if sel==1 then -- first weapon is already free to use so no if cod_lvl[id]...
setweapon(id,2,1)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=3 then
setweapon(id,2,2)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==3 then
if cod_lvl[id]>=7 then
setweapon(id,2,4)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==4 then
if cod_lvl[id]>=12 then
setweapon(id,2,6)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==5 then
if cod_lvl[id]>=17 then
setweapon(id,2,5)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
elseif sel==6 then
if cod_lvl[id]>=21 then
setweapon(id,2,3)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Weapon!')
secw(id)
end
end
elseif (menu == 'Select your extra Grenade:') then
if sel==1 then
setweapon(id,3,51)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=8 then
setweapon(id,3,52)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Grenade!')
gres(id)
end
elseif sel==3 then
if cod_lvl[id]>=12 then
setweapon(id,3,53)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Grenade!')
gres(id)
end
end
elseif (menu == 'Select your first Extra:') then
if sel==1 then
setweapon(id,4,90)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=15 then
setweapon(id,4,54)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==3 then
if cod_lvl[id]>=18 then
setweapon(id,4,77)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==4 then
if cod_lvl[id]>=23 then
setweapon(id,4,92)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==5 then
if cod_lvl[id]>= 29 then
setweapon(id,4,93)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==6 then
if cod_lvl[id]>=32 then
setweapon(id,4,79)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==7 then
if cod_lvl[id]>=34 then
setweapon(id,4,99)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
elseif sel==8 then
if cod_lvl[id]>=36 then
setweapon(id,4,101)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra1(id)
end
end
elseif (menu == 'Select your second Extra:') then
if sel==1 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,58)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=27 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,49)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==3 then
if cod_lvl[id]>=25 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,91)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==4 then
if cod_lvl[id]>=28 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,95)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==5 then
if cod_lvl[id]>=30 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,47)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==6 then
if cod_lvl[id]>=31 then
extrarifle(id)
cod_exr[id] = 1
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==7 then
if cod_lvl[id]>=32 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,94)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
elseif sel==8 then
if cod_lvl[id]>=7 then
if cod_exr[id]==1 then
cod_exr[id] = 0
setweapon(id,2,1)
end
setweapon(id,5,96)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this Extra!')
extra2(id)
end
end
elseif (menu == 'Select your shotgun:') then
if sel==1 then
setweapon(id,1,10)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=14 then
setweapon(id,1,11)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
shotgunm(id)
end
end
elseif (menu == 'Select your Sub maschine Gun:') then
if sel==1 then
setweapon(id,1,21)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=2 then
setweapon(id,1,23)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
elseif sel==3 then
if cod_lvl[id]>=4 then
setweapon(id,1,20)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
elseif sel==4 then
if cod_lvl[id]>=6 then
setweapon(id,1,24)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
elseif sel==5 then
if cod_lvl[id]>=10 then
setweapon(id,1,22)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
Submgunm(id)
end
end
elseif (menu == 'Select your Rifle:') then
if sel==1 then
setweapon(id,1,35)
slotmenu(id)
elseif sel==2 then
if cod_lvl[id]>=5 then
setweapon(id,1,38)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==3 then
if cod_lvl[id]>=9 then
setweapon(id,1,37)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==4 then
if cod_lvl[id]>=11 then
setweapon(id,1,39)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==5 then
if cod_lvl[id]>=13 then
setweapon(id,1,30)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==6 then
if cod_lvl[id]>=16 then
setweapon(id,1,31)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==7 then
if cod_lvl[id]>=19 then
setweapon(id,1,34)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
riflesm(id)
end
elseif sel==8 then
if cod_lvl[id]>=20 then
setweapon(id,1,33)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm(id)
end
elseif sel==9 then
riflesm2(id)
end
elseif (menu == 'Select your Rifle2:') then
if sel==1 then
if cod_lvl[id]>=22 then
setweapon(id,1,36)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm2(id)
end
elseif sel==2 then
if cod_lvl[id]>=26 then
setweapon(id,1,32)
slotmenu(id)
else
cod_msg2(id,3,'You need more XP to use this weapon!')
rilfesm2(id)
end
elseif sel==3 then
riflesm(id)
end
elseif (menu == 'Select your Slot:') then
if sel==1 then
cod_slot[id] = 1
elseif sel==2 then
cod_slot[id] = 2
elseif sel==3 then
cod_slot[id] = 3
elseif sel==4 then
cod_hudinfo(id)
elseif sel==5 then
adminhelpm(id)
end
elseif (menu == 'Select your secondary rifle:') then
if sel==1 then
setweapon(id,2,38)
elseif sel==2 then
setweapon(id,2,39)
elseif sel==3 then
setweapon(id,2,30)
elseif sel==4 then
setweapon(id,2,31)
elseif sel==5 then
setweapon(id,2,33)
elseif sel==6 then
setweapon(id,2,32)
end
elseif (menu == 'Streaks:') then
if sel==1 then
fkillsm(id)
elseif sel==2 then
skillsm(id)
elseif sel==3 then
ftkillsm(id)
elseif sel==4 then
if cod_str_a[id]==0 then
cod_str_a[id] = 1
else
cod_str_a[id] = 0
end
end
elseif (menu =='4 Kills:') then
if sel==1 then
setstreak(id,1,1)
elseif sel==2 then
setstreak(id,1,2)
end
elseif (menu =='6 Kills:') then
if sel==1 then
setstreak(id,2,1)
elseif sel==2 then
setstreak(id,2,2)
end
elseif (menu =='15 Kills:') then
if sel==1 then
setstreak(id,3,1)
elseif sel==2 then
setstreak(id,3,2)
end
end
end
function cod_parse(cmd)
if (cmd == cod_commands[1]) then
cod_print(2,'====== Console Commands List ======')
for i = 1,5 do
cod_print(2,cod_commands[i]..''..cod_commands_inf[i])
end
return 2
end
if (cmd == cod_commands[2]) then
cod_print(2,'====== Say Commands List ======')
for i = 1,1 do
cod_print(2,'!help for information')
cod_print(2,'rank for your ranking')
end
return 2
end
if (cmd == cod_commands[3]) then
cod_print(2,'====== Players List ======')
for i = 1,pl_count do
if (player(i,"exists")) then
if (player(i,"health") > 0) then
cod_print(2,player(i,"name").." - Level: "..cod_lvl[i].." - Experience: ("..cod_xp[i].."/"..cod_nxp[i]..")")
else
cod_print(4,player(i,"name").." (dead) - Level: "..cod_lvl[i].." - Experience: ("..cod_xp[i].."/"..cod_nxp[i]..")")
end
end
end
return 2
end
if (string.sub(cmd, 1, == cod_commands[4]) then
local parses = totable(cmd)
local pl = tonumber(parses[2])
local xp = tonumber(parses[3])
if (pl ~= nil) and (xp ~= nil) then
if (player(pl,"exists")) then
cod_print(2,'You Gave '..xp..' xp for '..player(pl,"name")..'!')
cod_msg2(pl,2,'You got '..xp..' from Admin!@C')
give_xp(pl,xp)
else
cod_print(4,'This player does not exist!')
end
else
cod_print(4,'The player or the xp is wrong!')
end
return 2
end
if (string.sub(cmd, 1, == cod_commands[5]) then
local parses = totable(cmd)
local i = tonumber(parses[2])
local st = tonumber(parses[3])
local am = tonumber(parses[4])
if (i~=nil) and (st~=nil) and (am ~= nil) then
if (player(i,"exists")) then
if st==1 then
cod_tkil
2× editiert, zuletzt 25.08.11 03:23:16