F1 Menu

Hello,

I have an question.
How do i make an F1 Menu?
i know vgui but i can’t get it on f1.
It’s for my gamemode.

Thanks for the help.

Just edit the GM:ShowHelp() function.
[lua]
GM:ShowHelp( ply )
ply:PrintMessage( 1, “You pressed the f1 button.” );
end
[/lua]

Pretty much what Capsup said.

Create a menu on the client files, and have the menu linked with a console command**[li]**.
[/li]
Use the GM:ShowHelp hook on the server to call console command on the client. Just like it’s shown on the example on that page.

Oh wow thank you :slight_smile:

Do i put it in init or cl_init?

cl_init because it is client side.

Nope it is init.lua i checked it ;D

[editline]03:08PM[/editline]

NVM. i dind’t read good

You cannot make derma in init.lua.

Nope but the activate function in init
and the derma in cl.init

I’m trying to add an radio any idea’s how?

a radio that plays during the F1 menu?

Yes and when it’s closed

use http://wiki.garrysmod.com/?title=Panel.SetHTML