Sign displaying town population based on number of users on the server.

I’m not sure if it would be possible.

Also, I didn’t know if this is more of scripting or if it’s possible in the map, but since it would appear on the map, I thought this would be the right section.

Would it be possible to have like, 53 textures, number from 1-52, and one sign that says, "Population:"then under it would be the other half, but it would look as if it made a full sign.

I’m just curious of how you could do this, or if it would be possible in the map to make it so that the textures would change to display how many users are in the server.

Well, any information on this will be appreciated. :slight_smile: And if this isn’t possible through the map, could a moderator please move this to the correct section?

Would require lua.

Ah, so there’s no way through the map? That stinks. Is it possible to like, pack a Lua into the map so it would always do that? Or would the server always have to do it themselves?

There is a lua_run entity in the garrysmod.fgd

Oh, alright. Do you think something like that would be hard? Or would it just like, check how many people are on the server, then it changes to the texture?

Example:
28 people on the server.
It displays sign_population28.vmf (or vmt, which ever is the main one.)

Why not cover the entire map with a trigger_multiple, and and add one to Math counter when “OnStartTouch”, and hope “OnEndTouch” works when they leave. Then you could set up a series of relays to make a material changer, or one of the old baseball boards where the cards flip to make a new number.

Actually lord, good idea. Then I could just download 18 textures. So I could have it set up as like…
sign_populationleft1
sign_populationright1

And go up to 9 with both of those, that way if servers upgrade it could go up to 99. ^^

But yeah, is there a way to make a like, (I’m pulling this next “On” out of my ass, I know it’s not real.) OnPlayerDisconnect or something? I mean is there anything like that? But thanks for that, I like the idea. :slight_smile:

Lord Ned said what I was going to say. You don’t need LUA. Not even custom textures… Just have it spawn the numbers or something.

^ Should work for gmod, just add some logic_cases, make 7-segment digits and it should work. Don’t forget to make the timer to fire outputs from that entity though

That entity doesn’t check how many people are in it. It just checks if a player is in it.

PlayersOutCount,some_math_counter,invalue
:stuck_out_tongue:

Would need a lot of outputs. Ned’s way is easier.

Would it be possible to make one huge trigger around the map, that counts everyone? It sounds dumb but yeah :S

Eh, I’ve worked with both ways, and I was able to glitch the end/start touch output (multiplayer glitches, that system works perfectly in SP). So when I was making something like that, i used game_zone_player. It is easy to use. You can get count of players in anytime you want, and that’s less/same amount of outputs. To make it update automatically, just set logic_timer to CountPlayersInZone every 3 secs or so. Basically you can create small trigger in unreachable place and measure amount of players by ‘PlayersOutCount <integer>’. That’s better than GIANT TRIGGER OVER A MAP!

The giant trigger would have been pretty though. ;[

But would something like that really work?

[editline]2:46[/editline]
Also, how would I make it display the textures?

this?

Oh, yeah. Thanks. ^^