AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Monster damage event (https://forums.alliedmods.net/showthread.php?t=53621)

Nican 04-07-2007 18:00

Monster damage event
 
How can I know in sven-coop when a monster has taken damage, how much damage was it, and who was the attacker?


I was able to find this:
http://forums.alliedmods.net/showpos...59&postcount=4

But i was not able to put it to work :/



Edit:
Never mind, i just found out that mr. sawce had put a updated version of his module on the middle of the post

Nican 04-07-2007 19:29

Re: Monster damage event
 
I still need help

I did
PHP Code:

public plugin_init(){
register_takedamage("monster_alien_slave","hook_takedamage");
}

public 
hook_takedamage(idHostage,idInflictor,idAttacker,Float:damage,type)
{
    
client_print(0,print_chat,"idHostage = %i | idInflictor = %i | idAttacker = %i | damage = %f | type = %i",idHostage,idInflictor,idAttacker,damage,type)
    return 
HAM_IGNORED;


And everytime i see (not even attack) a alien_slave the server crashes

Nican 04-08-2007 11:52

Re: Monster damage event
 
Can someone please help me?

Silencer123 04-08-2007 12:36

Re: Monster damage event
 
Do you have 64 bit?
Note: No 64 bit support. 64 bit can go to hell.
...

Nican 04-08-2007 13:46

Re: Monster damage event
 
Dang D:
The only 32bit computer i hate is running linux
and sven-coop does not support linux D:

Thank you :D
+karma

Silencer123 04-08-2007 14:04

Re: Monster damage event
 
Thanks - Hey, it says my Karma is "Good" - stylish :D ^^
If the devs at sc are wise, linux will be supported in 3.5,
but i am not sure if so. If this module would work with 64 bit, too,
then it would be very cool, because I could make additional damage
skill and resistances in SCXPM 20.0 without seeing people crying it
is not working, including myself with my new pc. ^^" You sure know
SCXPM if u play svencoop - Im teh author. ^^ btw how is your enting
community going?

|POW|Da_ghost 04-08-2007 15:42

Re: Monster damage event
 
http://forums.alliedmods.net/showthread.php?t=46712

Silencer123 04-08-2007 16:52

Re: Monster damage event
 
Um... I get a undefined symbol "register_takedamage"
:(

Wilson [29th ID] 04-08-2007 18:53

Re: Monster damage event
 
Try using hs_takedamage instead of register_takedamage

If that doesn't work, try this.


Nican 04-08-2007 21:30

Re: Monster damage event
 
hs_takedamage is a native...

Quote:

/**
* Calls the mod's private damage routine.
* -
* parameters:
* id: index of the entity that is to be damaged
*
* inflictor: the entity that is "doing the damage" (eg a weapon)
*
* attacker: the entity who controls the inflictor (eg weapon holder)
*
* damage: how much damage to do to the victim
*
* type: bitmask of damage flags. Most mods do not
* follow the standard HLSDK damage flags, so
* you may have to do some testing!
* The only flags I figured out were CS related:
* * (1<<6) = no slowdown on damage
* * (1<<13) = always gib
* * (1<<12) = never gib
*
* -
* Note: Setting damage to a ridiculously high value can mess up
* some mods!
*/
native hs_takedamage(id,inflictor,attacker,Float:dam age,type);
Well.. i will just have to live with my generic function :/

Thank you anyway :D


All times are GMT -4. The time now is 06:33.

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