AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to use take_damage? (russ?) (https://forums.alliedmods.net/showthread.php?t=82784)

fafik91 12-29-2008 22:06

How to use take_damage? (russ?)
 
May anyone know how to use take_damage function?
Может кто знает как использовать эту функцию?

SnoW 12-30-2008 05:33

Re: How to use take_damage? (russ?)
 
There is multilangual forum if you want to use your own language.
Code:

#include <amxmodx>
#include <hamsandwich>
public plugin_init()
{
  RegisterHam(Ham_TakeDamage, "function", "player");
}
public function(this, inflictor, attacker, Float:damage, damagebits)
{
  SetHamParamFloat(4, damage * 2.0);
  return HAM_HANDLED;
}

When you set the ParamFloat you probably understand that it's a float, so remember to use desimals. There it does double damage, but for no damage it would be:
Code:

SetHamParamFloat(4, 0.0);
Ofc there is many damage events, but still ham... well, too complicated.

fafik91 12-30-2008 07:00

Re: How to use take_damage? (russ?)
 
ok! but what about take_damage() ?

xPaw 12-30-2008 07:13

Re: How to use take_damage? (russ?)
 
it was take_damage just with hamsandwich.

fafik91 12-30-2008 07:16

Re: How to use take_damage? (russ?)
 
i have no hamsandwich... can i do it without hamsandwich?

hzqst 12-30-2008 07:56

Re: How to use take_damage? (russ?)
 
take_damage is a native
Ham_TakeDamage is a forward
.....

fafik91 12-30-2008 07:57

Re: How to use take_damage? (russ?)
 
ok then. can u tell me how can i increase player damage, i've tried all variants...

hleV 12-30-2008 08:47

Re: How to use take_damage? (russ?)
 
Quote:

Originally Posted by SnoW (Post 735406)
Code:

  RegisterHam(Ham_TakeDamage, "function", "player");

I think it's:
Code:
  RegisterHam(Ham_TakeDamage, "player", "function");
@fafik91, just get newest AMXX and enable HamSandwich module.

SnoW 12-30-2008 08:55

Re: How to use take_damage? (russ?)
 
Hmm... It seems that you are right, I have used it also like that, still it's on wiki like in my first post, there must be some mistake:
RegisterHam(Ham_TakeDamage, "player_hurt", "player");
http://wiki.amxmodx.org/HamSandwich_...28AMX_Mod_X%29

fafik91 12-30-2008 09:15

Re: How to use take_damage? (russ?)
 
doesn't work anyway


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

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