Garrysmod scripts:Server entity counter

From Serenity Servers Support

This script create a server details bar at the top.

To use this script, navigate to lua/autorun/client and in this folder you create a new file called counter.lua

In that file, paste the code below and save it. Now restart, and enjoy!

local function allProps()
	if ( propWait or 0 ) > CurTime() then return propCount end
		propCount = #ents.FindByClass( "prop_physics" )
		propWait = CurTime() + 1
	return propCount
end

hook.Add( "HUDPaint", "bloodwave.showpropsadmin", function()
	local ply = LocalPlayer()

	local w = 120
	local h = 50
	local x = ScrW() - w - 5
	local y = 5

	draw.RoundedBox( 2, x, y, w, h, Color( 0, 0, 0, 100 ) )

	draw.SimpleText("Server Details:", "Trebuchet18", x + 5, y + 2, color_white )
	draw.SimpleText( allProps().." props", "Trebuchet18", x + 5, y + 5 + 8, color_white )
	draw.SimpleText( #ents.GetAll().." entities", "Trebuchet18", x + 5, y + 5 + 22, color_white )
end )

Banner
Promo