Quote:
Originally Posted by stefanhendriks
it was my e-mail on the hlcoders list.
|
I know, I just didn't wanted to point you out...
Quote:
Originally Posted by stefanhendriks
Afaik you cannot process client commands on fake clients with HL2 because they are ignored by the engine. So somehow we need to do it the hard way and pass it via the Cmd_<> functions.
|
First please read (again?) as that isn't what I wrote, secondly to make a hook on any command in the exposed interfaces is easy and safe, wich I also wrote. (On linux it's two lines if you know the function number.)
I do agree you have to hook the engine's Cmd_<> functions, but I said that the game.dll ClientCommand is not enough to call as it is called by the engine for only a few commands (such as joingame, jointeam, ...). You have to call the registered ConCommand's callback (as I described) to execute the correct functions. Remember that ClientCommand exist in both the game.dll and engine interface (and I talked about the game.dll)...
There are though some limitations as some commands are client side only and some are different on the server and the client (such as kick and disconnect)... Also some "commands" are handled through the ProcessUsercmds (such as weapons)...
One solution to fix disconnect could be to also hook the dicsonnect ConCommand and if command index is not the console, then run the server "kick" command on the player/bot. With HPB-bot2, kick with name works but not kickid. Probably related to the autokick bug in the CSmod that still uses the old "kick" instead of "kickid". (So what I did to fix the autokick bug I made a hook on kick and then re-issuing the server command with "kickid" instead.)
As you asked for help and seam to have some good reputation on this site I thought I would share my findings with you... as I have "hurtme" and "say" working for me with both HPB-bot2 and real clients. "hurtme" also kills the players/bots correctly when health is 0 or negative.
If you ask for help, at least you should read the responses...
Well, god luck... over and out, and gone...
/X