Zombie Plague (For GMOD)

Introduction
This is an old gamemode (AMX Modx) that I played a lot, so I decided to make a GMOD version.
Zombie Plague is a Zombie Horror gamemode where there’s a pacient zero. And there are a lot of humans to be infected. The last human alive will not be infected, but killed without mercy.

There are 7 default round types
Single Infection round - One random player will be infected and He should infect other players.
Multi Infection Round - Same thing as Single Infection Round, the difference is there are more zombies.
Swarm Mod Round - Half of players are zombies, Half of players are humans. There’s no infection, only deaths.
Plague Mod - Same as Swarm Mod, the difference is that there is one nemesis and one survivor.
Deathmatch Plague Mod - Same as Plague mode, but with respawn.
Nemesis Round - Everybody except one random player (that is going to be the nemesis) will be human. Nemesis should kill every human (Nemesis cause more damage).
Survivor Round - Everybody except one random player (that is going to be the survivor) will be zombie. Survivor should kill every zombie (Survivor cause more damage).

You can add more round types
Wanna create your own round type? Just do It! Add a new round type is easy as add an addon.
To do this You need to create a .lua inside: gamemode/rounds with some atributes:



local RoundType = {
Name -- Name of the round
Chance -- The chance of this round be called (Total of all valid round).
MinPlayers -- Min players to this round.
SpecialRound -- Set to true if You wanna make a no infection round (Players will take damage instead get infected).
StartFunction -- This function will be called when the round starts.
RoundManager:AddRoundType(RoundType) -- Register the new round.

--Example:
RoundManager:AddRoundType({Name = "Multi Infection Mode",
		Chance = 30,
		MinPlayers = 4,
		SpecialRound = false,
		StartFunction = function()
			local ValidPlayers = RoundManager:GetPlayersToPlay(true) -- Get alive players
			table.remove(ValidPlayers, math.random(1, table.Count(ValidPlayers))):Infect()
			table.remove(ValidPlayers, math.random(1, table.Count(ValidPlayers))):Infect()
		end}
)


There are Zombie Classes
You can choose your Zombie Class. Each Zombie Class has its own characteristics.

You can make your own zombie class
Wanna make a better zombie? No problem. Add a .lua file inside gamemode/classes with:



local ZombieClass = {Name -- The Name of the zombie class
		MaxHealth -- Zombie Class' max health
		PModel -- Zombie Class' player model
		Speed -- Zombie Class' speed
		RunSpeed --Zombie Class' Run Speed
		CrouchSpeed -- Zombie Class' Crouched speed
		Gravity -- Zombie Class' gravity
		Breath -- Zombie Class' breath (Currently not in use)
		Footstep -- If the class should emit footstep sounds
		JumpPower = Zombie Class' jump power
		InfectionFunction -- This function will be called when player gets infected,
		FallFunction -- This function returns true/false and is used to set if this Zombie Class should take fall damage.
                ZombieClassAux.WeaponGive This functions will define which weapon you will earn when get infected (Player ply)
	}
ClassManager:AddZombieClass(Zombieclass class) -- Used to register a new zombie class

--Example:
ClassManager:AddZombieClass({Name = "Light Zombie",
		MaxHealth = 1000,
		PModel = "models/player/charple.mdl",
		Speed = 230,
		RunSpeed = 240,
		CrouchSpeed = 0.4,
		Gravity = 0.5,
		Breath = 50,
		FallFunction = function()return false end
	}
)


There are Human Classes
You can choose your Human Class. Each HumanClass has its own characteristics.

You can make your own human class
Wanna make a better human? No problem. Add a .lua file inside gamemode/classes with:



local HumanClassAux = {Name -- Human Class' name
		MaxHealth -- Human Class' max health
		Armor -- Human Class' armor
		PModel -- Human Class' player model
		Speed -- Human Class' speed
		RunSpeed -- Human Class' run speed
		CrouchSpeed --HumanClass.CrouchSpeed or 0.4,
		Gravity -- Human Class' gravity
		Battery -- Human Class' battery (Used by flashlight, voice and nightvision)
		Breath -- Human Class' breath (Currently not in use)
		JumpPower -- Human Class' jump power
		Footstep -- If the class should emit footstep sounds
		FallFunction -- This function returns true/false and is used to set if this Zombie Class should take fall damage.
	}
ClassManager:AddHumanClass(HumanClass class) -- Used to register a new human class

--Example:
ClassManager:AddHumanClass({Name = "Light Human",
		MaxHealth = 100,
		PModel = "models/player/p2_chell.mdl",
		Speed = 240,
		RunSpeed = 250,
		CrouchSpeed = 0.4,
		Gravity = 0.5,
		Battery = 50,
		Breath = 50,
		FallFunction = function()return false end
	}
)


Add any SWEP that You want
When I design this gamemode. I focus on easy weapon insert. The only thing that You must do is create a lua file inside: “gamemode/weapons” with this atributes:



Weapon.PrettyName -- Weapon's name that will be showed to client.
Weapon.WeaponID - weapon_id
Weapon.DamageMultiplier --  Wanna nerf/buff a weapon? Set here (This value must be a valid value for ScaleDamage - https://wiki.garrysmod.com/page/CTakeDamageInfo/ScaleDamage).
Weapon.GiveWeapon -- Wanna change the way that the server gives this weapon? Override this function. (Par: Player ply)

--Example
Weapon.PrettyName = "Crossbow"
Weapon.WeaponID = "weapon_crossbow"
Weapon.DamageMultiplier - 2 (Double damage)
function Weapon:GiveWeapon(ply)
	Weap = ply:Give(self.WeaponID)
	ply:GiveAmmo((Weap:GetMaxClip1() or Weap:GetMaxClip2()) * 10, Weap:GetPrimaryAmmoType(), true) 
end


Extra-items/Ammo-packs
Like in CS1.6, this gamemode have extra items that can be bought by ammo packs.
You will earn 1 ammo pack every 500 damage caused (default value) and 5 ammo packs per player infected.
Wanna create a new one? Add a .lua file inside gamemode/extraitems with:



local ExtraItem = {Name -- The Name of the extra item
Price -- The Price of the extra item
OnBuy -- What the extra item should do when bought (Player ply)
CanBuy -- Can Buy function (return true/false)
}

ExtraItemsManager:AddZombieExtraItem(ExtraItem) -- Register the new item to zombies
ExtraItemsManager:AddHumanExtraItem(ExtraItem) -- Register the new item to humans

--Example:
local ZombieMadness = {Name = "Zombie Madness", Price = 15}
function ZombieMadness:OnBuy(ply)
	ply:SetLight(Color(255, 0, 0))
	ply:GodEnable()
	ply:ZPEmitSound(SafeTableRandom(ZombieMadness), 5, true)
	timer.Create("ZPGod" .. ply:SteamID64(), 5, 1, function()
		ply:SetLight(nil)
		ply:GodDisable()
	end)
end
ExtraItemsManager:AddZombieExtraItem(ZombieMadness  )


Multi-language
This gamemode supports multi-language. Currently supports English and Brazilian Portuguese.

Maps to play
This gamemode doesn’t have a prefered type map to play. But open maps will be difficult for humans to survive (default votemap will find ‘zm_’ and ‘ze_’ maps).

Things to do
1 - Logo/icon to this gamemode.
2 - Weather/sunlight changing depending on the round type.
3 - Admin menu.
4 - Gamemode documentation.
5 - More maps.
6 - Find more effect sounds.
7 - Round type soundtrack (Like in the old one).
8 - Shared files.
9 - Create a zombie knife.

Known bugs

  • There’s no bugs related. Please report if You find.

Media

Special thanks
MeRcyLeZZ - Creator of this gamemode. You’re cool, man.
Facepunch community - I know I’m an annoying person. But You helped me a lot. Thanks.
Clã | BR - Love You guys.

Download
Source code (Github)
Source code/Files (Dropbox)

Hey great gamemode! I only have one issue with it so far. The RTV isnt getting any of my zm_ maps it seems to be getting css maps and gmod maps.

New version getting out today. Now you can change the prefix to search.