Nem syntax:
PHP Code:
stock void DealDamage(int nClientVictim, int nDamage, int nClientAttacker = 0, int nDamageType = DMG_GENERIC, char[] sWeapon = "")
// ----------------------------------------------------------------------------
{
// taken from: http://forums.alliedmods.net/showthread.php?t=111684
// thanks to the authors!
if( nClientVictim > 0 &&
IsValidEdict(nClientVictim) &&
IsClientInGame(nClientVictim) &&
IsPlayerAlive(nClientVictim) &&
nDamage > 0)
{
int EntityPointHurt = CreateEntityByName("point_hurt");
if(EntityPointHurt != 0)
{
char sDamage[16];
IntToString(nDamage, sDamage, sizeof(sDamage));
char sDamageType[32];
IntToString(nDamageType, sDamageType, sizeof(sDamageType));
DispatchKeyValue(nClientVictim, "targetname", "war3_hurtme");
DispatchKeyValue(EntityPointHurt, "DamageTarget", "war3_hurtme");
DispatchKeyValue(EntityPointHurt, "Damage", sDamage);
DispatchKeyValue(EntityPointHurt, "DamageType", sDamageType);
if(!StrEqual(sWeapon, ""))
DispatchKeyValue(EntityPointHurt, "classname", sWeapon);
DispatchSpawn(EntityPointHurt);
AcceptEntityInput(EntityPointHurt, "Hurt", (nClientAttacker != 0) ? nClientAttacker : -1);
DispatchKeyValue(EntityPointHurt, "classname", "point_hurt");
DispatchKeyValue(nClientVictim, "targetname", "war3_donthurtme");
RemoveEdict(EntityPointHurt);
}
}
}
Regards.
__________________
My Plugins |
VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet
CZSBrasil TEAM