Hey i would like to know how to open derma panel with a Say Command.. I am trying to find it but i dont know what to add so if you could help me with this. So server and client side. So lets say the command is !hello and than opens the derma panel.
Best regards
This should help you: [url]http://wiki.garrysmod.com/page/GM/PlayerSay[/url]
PlayerSay is serverside meaning you'd need to network data to the client to open a window, or you can tie the vgui window to a console command and run a console command when ! or / is used in chat
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/motd.lua.html[/url]
Chat commands example: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/chat_commands/chat_commands.lua.html[/url]
That will turn all !xxx and /xxx written into chat turn into a console command: xxx whereby ! is output for all to see and / is silent.
If you want to see an example of networking data from the server to client in order to open vgui, take a look at this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/open_vgui_based_on_keypress.lua.html[/url]
That turns F1-F4 hooks ( which are serverside ) into something that networks data to the client so the client can open the vgui ( example 1 ). Example 2 shows how to use PlayerBindPress to keep everything serverside for those F1-F4 keys.
If you want to use chat to open your vgui, you can also use the clientside OnPlayerChat hook ( but you'll need to add one additional check to ensure the player typing the command is also the LocalPlayer( ) otherwise anyone can type the command and everyone will open the vgui window )
Sorry, you need to Log In to post a reply to this thread.