How do i bind chat prefix-type commands.

Is there any way i can make a bind that allows me to continue after a prefix. For example, I hit “I” and it will open chat with a /advert prefix, similar to say_team or something. I’ve tried using alias to give it a command but that doesnt work. Could i do something like : bind “I” “lua_run_cl Local ply = Player:ConCommand( “say /advert” … )”

or something along those lines?

This may be better suited in development discussion. I wanted to do a similar thing a long time ago on Minecraft.

bind [key] “lua_run_cl chat.Open(1)” - should open the chat box, how you then add text I’m not sure. Plus this would only work if the server had sv_allowcslua = 1.

The other solution may be if your keyboard supports binds, maybe you can setup a bind that presses the chat key-bind then the letters you need to enter the first half of the command :confused:

bind k “say k”

Linux_Torvald knows how to do that. They are asking how to have a bind that puts the start of the command in chat ready for it to be completed. Eg: Pressing ‘I’ puts '/kick ’ in the chat ready for a name to be entered.

bind k “say /kick @”

What is that meant to do?

ulx, * ^ @

I’ve never seen @ as a parameter? What is it meant to do?

@ = who you are looking at with ulx

  • = everyone with ulx
    ^ = self with ulx
    !%admin = all that are below admin, not including admin in ulx

[editline]29th February 2016[/editline]

I know everything abot that. I was more of asking exactly what semajnad said:

Ahh nice, I didn’t know about @ anyway.

Linus, I’m guessing the way to do it is to use chat.Open(1) to open the chat box, then add the text using VGUI something like DTextEntry:SetText("/kick ") but I’m not sure if you can edit the text in the chat box.