logs.Register("Spawns", false, Color(190, 190, 190))

logs.AddHook("PlayerSpawnedProp", function(ply, mdl)
	mdl = string.lower(mdl)

	logs.Log("Spawns", ply:NameID().." hat \""..mdl.."\" gespawnt", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["Modell"] = mdl,
	})
end)

logs.AddHook("PlayerSpawnedRagdoll", function(ply, mdl)
	mdl = string.lower(mdl)

	logs.Log("Spawns", ply:NameID().." hat \""..mdl.."\" gespawnt", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["Modell"] = mdl,
	})
end)

logs.AddHook("PlayerSpawnedEffect", function(ply, mdl)
	mdl = string.lower(mdl)

	logs.Log("Spawns", ply:NameID().." hat \""..mdl.."\" gespawnt", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["Modell"] = mdl,
	})
end)

logs.AddHook("PlayerSpawnedSENT", function(ply, ent)
	local entName = (ent.PrintName or ent:GetClass())

	logs.Log("Spawns", ply:NameID().." hat "..entName.." gespawnt", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["Gegenstand"] = entName,
	})
end)

logs.AddHook("PlayerSpawnedNPC", function(ply, npc)
	local name = npc:GetClass()
	if list.Get("NPC")[name] then
		name = list.Get("NPC")[name].Name
	end

	logs.Log("Spawns", ply:NameID().." hat "..name.." gespawnt", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["NPC"] = name,
	})
end)

logs.AddHook("PlayerSpawnedVehicle", function(ply, veh)
	local name = veh:GetVehicleClass()
	if list.Get("Vehicles")[name] then
		name = list.Get("Vehicles")[name].Name
	end

	logs.Log("Spawns", ply:NameID().." hat "..name.." gespawnt", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["Fahrzeug"] = name,
	})
end)

logs.AddHook("PlayerGiveSWEP", function(ply, class, swep)
	local name = (swep.PrintName or class)

	logs.Log("Spawns", ply:NameID().." hat sich "..name.." gegeben", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["Waffe"] = name,
	})
end)

logs.AddHook("PlayerSpawnSWEP", function(ply, class, swep)
	local name = (swep.PrintName or class)

	logs.Log("Spawns", ply:NameID().." hat "..name.." mit der Tool Gun gespawnt", {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID(),
		["Waffe"] = name,
	})
end)