Quote:
Originally Posted by joaquimandrade
I know a bit about this stuff so I can make it clear for you:
RegisterHam and RegisterHamFromEntity are ways of reaching a class' virtual table. You can read about it here: http://en.wikipedia.org/wiki/Virtual_method_table
RegisterHam does it by asking the game to create a dummy entity by using a classname like " weapon_ak47" that isn't more than a way of reaching the C++ class CAK47 (I think that's the name).
CZ Bots C++ class is CCSBot but there isn't a half life classname linked to it just for the reason that CCSBot are not considered entities or didn't need to be considered entities. So, you can't use RegisterHam with CZ Bots because there isn't a connection between classnames and the C++ class CCSBot.
|
Then can you make a hamsandwich stock to registerham for CZbot? I found this stock to registerham for CZbot. We need this kind of stock to make our coding job simple.
Please take a look.
PHP Code:
/**
* Hooks the virtual table for CZ Bots entity class.
* An example would be: RegisterHamBots(Ham_TakeDamage, "player_hurt");
* Look at the Ham enum for parameter lists.
*
* @param function The function to hook.
* @param callback The forward to call.
* @param post Whether or not to forward this in post.
* @return Returns a handle to the forward. Use EnableHamForwardBots/DisableHamForwardBots to toggle the forward on or off.
*/
native RegisterHamBots(Ham:function, const Callback[], Post=0);