Binding a chat command to a key for all players

Hi everyone,

I was wondering if anyone could give me some insight into binding a certain function which is activated by a chat command e.g. “!donate” to F2. So when a player is on my server and presses F2 it responds in the same way as if they typed !donate.

Cheers.

Take a look at http://wiki.garrysmod.com/page/Player/KeyPressed . This would allow you to check if a certain key was pressed
http://wiki.garrysmod.com/page/input/WasKeyPressed is also another one you can use.