04-29-2013, 04:41 AM
(04-29-2013, 04:38 AM)xoft Wrote: There are three TakeDamage functions in cPawn, none of them matches what you're calling:Thx it worked
/// Makes this pawn take damage from an attack by a_Attacker. Damage values are calculated automatically and DoTakeDamage() called void TakeDamage(cPawn & a_Attacker); /// Makes this pawn take the specified damage. The final damage is calculated using current armor, then DoTakeDamage() called void TakeDamage(eDamageType a_DamageType, cPawn * a_Attacker, int a_RawDamage, double a_KnockbackAmount); /// Makes this pawn take the specified damage. The values are packed into a TDI, knockback calculated, then sent through DoTakeDamage() void TakeDamage(eDamageType a_DamageType, cPawn * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount);The first one calculates damage based on what the attacker is wielding - not what you want here.
The second one subtracts armor value from RawDamage and deals that to the pawn - could be used, but the third one is better.
The third one uses everything that you specify and just deals the damage.
Note: Don't set a_Attacker to the player issuing the command, otherwise if we ever get the plugin that checks player distance before allowing damage, it would most likely forbid the kill. Use nil instead:
OtherPlayer:TakeDamage(dtInVoid, nil, 1000, 1000, 0);
In rev 1429 and later, you should also use dtAdmin or dtPlugin instead of dtInVoid.