AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help about HAM_TakeDamage (https://forums.alliedmods.net/showthread.php?t=98515)

Hydralisk 07-26-2009 06:37

Help about HAM_TakeDamage
 
I have a problem about hook the TakeDamage virtual function using HAMSANDWICH, Here is my code:

Code:

plugin_init()
{
        RegisterHam(Ham_TakeDamage,"player","ham_dodamage");
}

public ham_dodamage(victim, idinflictor, idattacker, Float:damage, damagebits)
{
        server_print("victim %d id %d idatt %d damage %f damagebits %d",victim,idinflictor,idattacker, damage, damagebits);

}

the problem is that when I hit a bot, nothing happend, on other word the server did not print the trace message ("victim....").. but when the bot hit me, it generates the trace message. How can i let it take effect to bots? Thanks in advance.

hleV 07-26-2009 06:40

Re: Help about HAM_TakeDamage
 
What bot exactly? PODBot or just some fake client (if so, read below)?
Code:
RegisterHam(Ham_TakeDamage,"player","ham_dodamage");
Replace "player" with an entity classname, that your bot has.

Hydralisk 07-26-2009 06:42

Re: Help about HAM_TakeDamage
 
Hello helv. It's not podbot, but the CS 1.6 BOT, I don't know if it should be called fake client. I tried to get the the bot's classname, It is "player"...

hleV 07-26-2009 06:43

Re: Help about HAM_TakeDamage
 
You mean ZBot? It's not supported here since they're illegal if used with CS 1.6. BTW are you using Steam?

Hydralisk 07-26-2009 06:49

Re: Help about HAM_TakeDamage
 
No Steam I think. You discovered it. My steam always crashes for unknown reasons so I have to find an alternative.

Hydralisk 07-26-2009 06:54

Re: Help about HAM_TakeDamage
 
Thx, I shall have to fight another way which have a same funtion.


All times are GMT -4. The time now is 18:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.