Disable spawns when no players are on the server

Hey,

I use a simple scavengemod on my server but when it’s midnight no players are online so I’d like the scavengemod not spawning any SPECIFIC entities around the map. So that the economy stays stable.

[LUA]
function SpawnProps26()
SpawnProp26(VectorRand() * 1, “”)
timer.Create(“SpawnProps26”, 2000, 1,SpawnProps26)
end
hook.Add(“InitPostEntity”,“SpawnTheProps”,timer.Simple(1,SpawnProps26))

	function SpawnProp26(position, model)
	local ent26 = ents.Create(table.Random({"drink_beer", "drink_scotch", "drink_wine", "drink_sunset", "drink_water", "drink_nukacola", "food_cram", "food_porknbeans", "food_instamash", "food_sugarbombs", "food_caravanlunch", "ammo_357", "ammo_9mm", "ammo_556", "ammo_20g", "med_stimpak", "med_superstimpak", "armour_leather"}))

		local ang = Vector(0,0,100):Angle(100);
		ang.pitch = ang.pitch + 90;
		-----printItem 31 have spawn in Batiment 2")
		ang:RotateAroundAxis(ang:Up(), 0)

		ent26:SetAngles(ang)
		ent26:SetModel(model)

		ent26:SetPos(Vector(-1315,7448,80))

		ent26:Spawn()

		end

[/LUA]

Thank you so much if you are able to help me out. :slight_smile: