Command Bindings

Another question,

I know that in custom gamemodes if you press f1, f2, f3, or f4 the coders have added functions to them.
First off, I want to bind the cursor to show on f1, I tried this code,
[lua]
function ShowMouse()
gui:EnableScreenClicker(true)
end
concommand.Add( “gm_showhelp” , ShowMouse )
//PS I know this will trap the mouse being on, but thats not what I’m worried about now
[/lua]
and it won’t work. I realized that the command gm_showhelp is declared elsewhere in the game code, and I want to override that declaration, and make it run my code. How can I do this?
Also, related to that, I want to bind ‘slot1’,‘slot2’,‘slot3’,etc. to my own functions.
Thanks for any help!

[lua]function GM:ShowHelp(ply)
ply:ConCommand("<3 it works")
end[/lua]

Thanks, I’ll just make a clientside concommand for it and put the gui stuff on the client. :smiley:

EDIT: OH! How/Can I override the Slot1 , Slot2, and such commands? Could I set GM:Slot1?

It’s Server Side.
[lua]
function GM:ShowHelp(ply)
ply:ConCommand("<3 it works") --F1
end

function GM:ShowHelp(ply)
ply:ConCommand("<3 it works") --F2
end

function GM:ShowSpare1(ply)
ply:ConCommand("<3 it works") --F3
end

function GM:ShowSpare2(ply)
ply:ConCommand("<3 it works") --F4
end[/lua]
[lua]
local GN = nil
function GN.slot1(ply)
ply:ConCommand(“O RLY”)
end
concommand.Add(“slot1”,GN.slot1) – Slot 1
[/lua]

Yeah, I was talking about making client concommand for the gui code then just use your ConCommand from the server, but I’ve fixed that.

However, the code you gave me for the slots does not work, I’m wondering if it can even be done.

[lua]
function slott1(ply)
ply:ConCommand(“O RLY”)
end
concommand.Add(“slot1”,slott1) – Slot 1
[/lua]

Yeah, I tried renaming the function, and I also just copy/pasted the code you have there, and it’s still not working. Maybe garry broke it with ConCommand? I’ll try it with a usermessage.