So, Below I will also leave a picture, but I would like something for my Defcons so it always displays until I turn it off.
I dont care how it looks, just want it there so someone doesnt have to spam CSAY and/or type it in when changing.
Top left, Where it says Defcon 3. I want something like that.
What do I do and how?
If you use the HUDPaint hook on the client, it’ll paint it to every client already. If how you detect defcons is serverside, then you need to network. If it can be detected clientside, then no networking needed.
I don’t think you guys what networking is nor what the states of Lua mean. Lemme teach you :magic101:
Within Garry’s Mod’s Lua environment there exists 2 primary states excluding the menu state which is essentially the clientside state with higher control over your Garry’s Mod client. These two states are known as clientside and serverside. With respects to the name, clientside exists only on the client (i.e. playable game) and normally operated independently without affecting the serverside state. The serverside state on the other hand contains game logic, game rules, and controls the clients connected to the server. The serverside state usually cannot work independently outside of networking without affecting the clientside state.
The clientside state does not represent a centralized system of clients. Instead, the clientside state refers to every player connected and what each player can observe through their computer (e.g. HUD elements, sounds, drawn geometry). You could think of the clients as a bunch of students in a classroom, one cannot cannot simply take over and dictate everyone, instead they would need to communicate with the precessor (i.e. server) of the class room. To reiterate, A client cannot directly influence other clients in their nature unless they send a message to the server and it gets distributed accordingly based on the server’s discretion.
The best way to think of the serverside state is the professor of a classroom. The professor in this scenario can lecture to their students, kick them out, give them all a PowerPoint or ask one of their students for a small conference after class. The serverside state directly influences it’s players through networking whether it be all of them, or a select focus group of players (e.g relay a message to admins).
First and foremost there’s no such thing as ‘shareside’ because shared mearly refers to the Lua file is accessable from both the client and the sender. How both states interpret that data is entirely based on it’s resulting conditions unsure unique to each state. But yeah, there is no shared state so stop trying to make a variable in the shared state and maintain it’s value on both states without networking it.