Question on ShowHelp, ShowTeam, ShowSpare1, and ShowSpare2
2 replies, posted
Why are ShowHelp, ShowTeam, ShowSpare1, and ShowSpare2 server side only functions?
These functions are solely used (to my knowledge) to open and close client side Derma Menus. Why do I need to tell the server, to have to the server send a usermessage to the client to open up the Menu. Doesn't this defeat the point of the function? To save a developer from having to create a Think function for checking for a input.IsKeyDown(KEY_*) system or concommand & usermessage system?
Official Wiki Pages:
[URL="http://wiki.garrysmod.com/page/GM/ShowHelp"]ShowHelp[/URL]
[URL="http://wiki.garrysmod.com/page/GM/ShowTeam"]ShowTeam[/URL]
[URL="http://wiki.garrysmod.com/page/GM/ShowSpare1"]ShowSpare1[/URL]
[URL="http://wiki.garrysmod.com/page/GM/ShowSpare2"]ShowSpare2[/URL]
[URL="http://wiki.garrysmod.com/page/GM/HideTeam"]HideTeam[/URL] (This one is kind of irrelevant, but why would this one be client side if the others are server side?)
From my knowledge, I thought it was to avoid using Text, or Console commands with input.IsKeyDown. Also, from my experience, I've had issues with the "Think" hook. Since it is called so quickly, if you hold the key down for more then 1 milisecond, it will draw 2 of your menus. This leads to adding a line to check if the menu is already drawn or not, and leads to unnecessary coding.
I think it's personal preference though.
I ended up doing that, a think function with a bunch of if statements. I just think it's extremely unnecessary to go from the client to the server then back just to toggle a client side menu. That and I don't like how I have to hard code buttons into a gamemode to avoid that. Now if someone changes their ShowHelp key from 'F1' to 'H' it wont reflect that change in the gamemode. Now without developing a whole system to emulate that sort of key binding.
Sorry, you need to Log In to post a reply to this thread.