Hello,
I would like to know if there is any way to bind a key for qc.
And also how to create a command and not by impulses (like the +hook in CTF).
Thank you,
Niit
PS: Sorry for the bad english, I'm from Brazil
Binds and commands, how i do?
binding a key in qc... stuffcmd(player, "bind uparrow +forward\n");
of course, that's hideous. you can't tell if they have that key bound or not, or if they have something else to do +forward, or anything like that so please don't do that.
creating +hook for instance:
stuffcmd(player, "alias +hook \"impulse 100\"\n");
stuffcmd(player, "alias -hook \"impulse 101\"\n");
then get the user to bind some key to do +hook and when they press it you'll receive impulse 100 followed by 101 when they release it again.
krimzon_sv_parseclientcommand allows you to use string commands instead of impulses, which are more reliable but mneh, impulses ftw.
of course, that's hideous. you can't tell if they have that key bound or not, or if they have something else to do +forward, or anything like that so please don't do that.
creating +hook for instance:
stuffcmd(player, "alias +hook \"impulse 100\"\n");
stuffcmd(player, "alias -hook \"impulse 101\"\n");
then get the user to bind some key to do +hook and when they press it you'll receive impulse 100 followed by 101 when they release it again.
krimzon_sv_parseclientcommand allows you to use string commands instead of impulses, which are more reliable but mneh, impulses ftw.
yeah, you could do the aliases via a mod-specific default.cfg
Its generally considered bad karma to put +hook aliases in autoexec.cfg and certainly binds shouldn't go in there, binds really ought to go in default.cfg
autoexec.cfg is expected to be for the user to modify, and overrides all. config.cfg is the previous settings (delete for defaults), and default.cfg is... the defaults.
course, if this is a quakeworld mod then chances are the user won't download any of that stuff anyway, so won't benefit from any of it so the only option is to stuffcmd those aliases.
Really it depends if your mod is server-only(or download-off-server) or if they really do need to download a full mod off some website before they can connect to that server.
Its generally considered bad karma to put +hook aliases in autoexec.cfg and certainly binds shouldn't go in there, binds really ought to go in default.cfg
autoexec.cfg is expected to be for the user to modify, and overrides all. config.cfg is the previous settings (delete for defaults), and default.cfg is... the defaults.
course, if this is a quakeworld mod then chances are the user won't download any of that stuff anyway, so won't benefit from any of it so the only option is to stuffcmd those aliases.
Really it depends if your mod is server-only(or download-off-server) or if they really do need to download a full mod off some website before they can connect to that server.