Author Topic: Anyway to damage through slayer without checking if they can damage?  (Read 1391 times)

I have been using minigameCanDamage, it returns 1, but, it will not damage.. Am I doing anything wrong?

How are you trying to damage a player?

I found a way, I packaged Projectile::onCollision.

%obj.damage(%source, %position, %damage, %type);

%obj.damage(%source, %position, %damage, %type);
This is what I used in Projectile::onCollison

I have been using minigameCanDamage, it returns 1, but, it will not damage.. Am I doing anything wrong?

minigameCanDamage only checks if you /can/ damage someone. It doesn't actually do damage.

This is what I used in Projectile::onCollison

Shouldn't the game handle projectile damage automatically? Post your code, please.

I wanted to bypass damage checks

function ProjectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal)
   {
      %objA = %obj.sourceObject;
      //Unrelated code was here and removed
      if(%objA.canFriDamage)
         %col.damage(%objA,%pos,%this.directDamage,%this.directDamageType,"body");
      return Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
   }

Well, now I am trying to use:


   function ProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
   {
      %objA = %obj.sourceObject;
      %damageType = $DamageType::Direct;
         if(%this.DirectDamageType)
            %damageType = %this.DirectDamageType;
      if(%objA.canFriDamage)
      {
         %col.damage(%objA,%pos,%this.directDamage,%damageType);
         %objA.client.centerPrint("Dmg: It works",1);
         return;
      }
      return Parent::damage(%this,%obj,%col,%fade,%pos,%normal);
   }

   function ProjectileData::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt)
   {
      %objA = %obj.sourceObject;
      %damageType = $DamageType::Radius;
         if(%this.RadiusDamageType)
           %damageType = %this.RadiusDamageType;
      if(%objA.canFriDamage)
      {
         %col.damage(%objA, %pos, %damageAmt, %damageType);
         %objA.client.centerPrint("it works",1);
         return;
      }
      return Parent::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt);
   }


No idea why it is not working..

I also packaged minigameCanDamage, and it says 1 when I try.
« Last Edit: April 02, 2014, 11:02:04 PM by Advanced Bot »


Do the projectile objects have canFriDamage = 1; and does direct damage work in that case?

what isn't working and did you run trace?
Do the projectile objects have canFriDamage = 1; and does direct damage work in that case?
wtf is canFriDamage?


wtf is canFriDamage?
If it is set to true on an object, they can bypass the damage checks and should just damage them.

I have not tried tracing it, I should though.