Cleanup and change of gamemode detection
This commit is contained in:
parent
f305d28544
commit
8dc476fa69
@ -1,7 +1,5 @@
|
||||
|
||||
|
||||
|
||||
if engine.ActiveGamemode() == "zombiesurvival" then
|
||||
if engine.ActiveGamemode() ~= "zombiesurvival" then return end
|
||||
|
||||
-- this code grabs the data from the file about the map. if none exists it makes a default.
|
||||
timer.Simple(25, function()
|
||||
@ -40,12 +38,9 @@ if !timer.Exists( "zombiepercentcalc" ) then
|
||||
timer.Create("zombiepercentcalc", 10, 0, function()
|
||||
if #(team.GetPlayers(TEAM_UNDEAD)) >0 then
|
||||
zombpercentcountmap =zombpercentcountmap + 1
|
||||
|
||||
end
|
||||
totpercentcountmap = totpercentcountmap + 1
|
||||
|
||||
|
||||
|
||||
end)
|
||||
end
|
||||
end)
|
||||
@ -53,7 +48,6 @@ end)
|
||||
hook.Add("EndRound", "givedapoints", function(winner)
|
||||
timer.Destroy("zombiepercentcalc")
|
||||
|
||||
|
||||
timer.Simple(0,function()
|
||||
print("point bonus hook")
|
||||
local mapname = string.lower(game.GetMap())
|
||||
@ -85,11 +79,6 @@ elseif mapplaytotal <= 5 then
|
||||
main["mapboost"] = mapboost
|
||||
main["mapjackpot"] = mapjackpot
|
||||
file.Write( "zsmapinfo/"..mapname..".txt", util.TableToJSON( main ) )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
if winner == TEAM_UNDEAD then
|
||||
if mapjackpot <= 2500 then
|
||||
@ -124,6 +113,7 @@ else
|
||||
else
|
||||
print("wow you fucked up!")
|
||||
end
|
||||
|
||||
local main = {}
|
||||
main["mapwins"] = mapwins
|
||||
main["maploss"] = maploss
|
||||
@ -164,7 +154,6 @@ else
|
||||
end
|
||||
end]]
|
||||
|
||||
|
||||
end
|
||||
if (game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") and gmod.GetGamemode().Name == "Zombie Survival" then
|
||||
if winner == TEAM_HUMAN then
|
||||
@ -181,7 +170,6 @@ if (game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_rebor
|
||||
ply:SaveMoneyTXT()
|
||||
ply:PrintMessage(HUD_PRINTTALK,"<c=255,0,0>You gained "..(pointstogive).." this round for playing to the end!</c>")
|
||||
end
|
||||
|
||||
else
|
||||
if ply:GetPoints()- ply:GetMoney()> 0 then
|
||||
ply:SetMoney(ply:GetPoints()+((ply:GetPoints()- ply:GetMoney())*.15)+(pointstogive/2))
|
||||
@ -208,4 +196,3 @@ if (game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_rebor
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
@ -27,7 +27,7 @@ his email is jaxschellhorn@gmail.com
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
|
||||
if engine.ActiveGamemode() ~= "zombiesurvival" then return end
|
||||
|
||||
hook.Add("PlayerInitialSpawnRound", "ps_set", function(ply)
|
||||
if gmod.GetGamemode().Name == "Zombie Survival" then
|
||||
@ -44,8 +44,7 @@ end
|
||||
end)
|
||||
|
||||
hook.Add("PlayerDeath", "ps_catch", function(ply)
|
||||
|
||||
if (ply:Team() == TEAM_HUMAN and game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") and gmod.GetGamemode().Name == "Zombie Survival" then
|
||||
if (ply:Team() == TEAM_HUMAN and game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") then
|
||||
ply:SetMoney(ply:GetPoints())
|
||||
-- WriteData(ply:SteamID64(), ply:GetPoints())
|
||||
-- PrintMessage(HUD_PRINTTALK,ply:GetDTInt(1))
|
||||
@ -57,7 +56,7 @@ end)
|
||||
|
||||
--[[hook.Add("EndRound", "ps_save", function(winner)
|
||||
print("end round hook")
|
||||
if (game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") and gmod.GetGamemode().Name == "Zombie Survival" then
|
||||
if (game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") then
|
||||
if winner == TEAM_HUMAN then
|
||||
for k,ply in pairs(player.GetAll()) do
|
||||
if ply:Team() == TEAM_HUMAN then
|
||||
@ -84,7 +83,7 @@ end
|
||||
end)]]
|
||||
|
||||
hook.Add("PlayerDisconnected", "ps_disc", function(ply)
|
||||
if (ply:Team() == TEAM_HUMAN and game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") and gmod.GetGamemode().Name == "Zombie Survival" then
|
||||
if (ply:Team() == TEAM_HUMAN and game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") then
|
||||
-- WriteData(ply:SteamID64(), ply:GetPoints())
|
||||
ply:SetMoney(ply:GetPoints())
|
||||
ply:SaveMoney()
|
||||
@ -96,7 +95,7 @@ end)
|
||||
hook.Add("PlayerRedeemed", "ps_redeem", function(ply)
|
||||
-- ply:SetPoints(ReadData(ply:SteamID64()))
|
||||
-- ply:SetMoney(ply:GetMoney())
|
||||
if (game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") and gmod.GetGamemode().Name == "Zombie Survival" then
|
||||
if (game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") then
|
||||
ply:SetPoints(ply:GetMoney())
|
||||
end
|
||||
end)
|
||||
@ -118,10 +117,8 @@ end)]]
|
||||
|
||||
-- ZSPS_Opt = CreateConVar("ZSPS_nosend", "0", FCVAR_ARCHIVE, "Opt out of the ZSPS server list"):GetBool()
|
||||
|
||||
|
||||
|
||||
hook.Add("PlayerSpawn" , "spawnplayerpoints" ,function(pl)
|
||||
if (pl:Team() == TEAM_HUMAN and game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") and gmod.GetGamemode().Name == "Zombie Survival" then
|
||||
if (pl:Team() == TEAM_HUMAN and game.GetMap() ~= "zs_obj_gauntlet_v3" and game.GetMap() ~="zs_gauntlet_reborn_b6") then
|
||||
pl:SetPoints(pl:GetMoney())
|
||||
-- pl:SetBegPoints(pl:GetDTInt(1))
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user