Who is your host?Haven PvE is ours
Still testing our new host, a small Windows 2008 Server VPS
Basically making:It seems DamageAmount is a ReadOnly property and can't assign it. Tried your admin one too in case I had it wrong, same thing.
Code:MissingMemberException: can't assign to read-only property DamageAmount of type 'PlayerHurtEvent'
PlayerHurtEvent.info.damageAmount = 0 # Should work.
Only thing is the PlayerHurtEvent is called after the the player was given bleeding and reduced health in Hooks.csBasically making:
Python:PlayerHurtEvent.info.damageAmount = 0 # Should work.
if (!fromPlayer) {
player.metabolism.bleeding.Add(Mathf.InverseLerp(0.0f, 100f, info.damageAmount));
player.metabolism.SubtractHealth(info.damageAmount);
player.TakeDamageIndicator(info.damageAmount, player.transform.position - info.PointStart);
}
if (!fromPlayer) {
player.SendEffect("takedamage_hit");
}
OnPlayerHurt.OnNext(new Events.PlayerHurtEvent(p, info));
if (!player.TestAttack(info) || !Realm.Server() || (info.damageAmount <= 0.0f))
return;
player.metabolism.bleeding.Add(Mathf.InverseLerp(0.0f, 100f, info.damageAmount));
player.metabolism.SubtractHealth(info.damageAmount);
player.TakeDamageIndicator(info.damageAmount, player.transform.position - info.PointStart);
player.CheckDeathCondition(info);
Or balu could simply add a Set { } at the damageamount pointer..Only thing is the PlayerHurtEvent is called after the the player was given bleeding and reduced health in Hooks.cs
This is where I get my no dmg to player for now, I modified the PlayerHurt function in Hooks with:
and so we don't see the red dmg effect:C#:if (!fromPlayer) { player.metabolism.bleeding.Add(Mathf.InverseLerp(0.0f, 100f, info.damageAmount)); player.metabolism.SubtractHealth(info.damageAmount); player.TakeDamageIndicator(info.damageAmount, player.transform.position - info.PointStart); }
****************************************************************************************************C#:if (!fromPlayer) { player.SendEffect("takedamage_hit"); }
****************************************************************************************************
NOW, If instead of my old version you put in Hooks.cs:
just beforeC#:OnPlayerHurt.OnNext(new Events.PlayerHurtEvent(p, info));
and add hitinfo = info; to PlayerHurtEvent.cs next to Victim = player; (because we don't get hitinfo from there or hurtevent, I tested)C#:if (!player.TestAttack(info) || !Realm.Server() || (info.damageAmount <= 0.0f)) return; player.metabolism.bleeding.Add(Mathf.InverseLerp(0.0f, 100f, info.damageAmount)); player.metabolism.SubtractHealth(info.damageAmount); player.TakeDamageIndicator(info.damageAmount, player.transform.position - info.PointStart); player.CheckDeathCondition(info);
Then YES, on the first call of PlayerHurtEvent, we can set the PlayerHurtEvent.hitinfo.damageAmount in our plugin to set it to whatever damage we want (including 0)
That means we are calling PlayerHurtEvent twice for the same hit though. It's just my hacky way to think of it, I am sure you guys can figure something better
Actually I could start pollishing the hurt/death events a bit >.<Or balu could simply add a Set { } at the damageamount pointer..
Maybe xDDActually I could start pollishing the hurt/death events a bit >.<
if (info.damageAmount > 0.0f) {
player.metabolism.bleeding.Add(Mathf.InverseLerp(0.0f, 100f, info.damageAmount));
player.metabolism.SubtractHealth(info.damageAmount);
player.TakeDamageIndicator(info.damageAmount, player.transform.position - info.PointStart);
player.CheckDeathCondition(info);
player.SendEffect("takedamage_hit");
}
public void KillTimer(string name)
{
TimedEvent timer = GetTimer(name);
if (timer != null)
return;
timer.Kill();
Timers.Remove(name);
}
public void KillTimer(string name)
{
TimedEvent timer = GetTimer(name);
if (timer == null)
return;
timer.Kill();
Timers.Remove(name);
}
Lmao... Does it work on players like you will fall slow?Did I just see AttachParachute(p.basePlayer);
Sooo yeah I had to try it:
![]()
LOL something newDid I just see AttachParachute(p.basePlayer);
Sooo yeah I had to try it:
![]()
Where did you find AttachParachute(p.basePlayer)?Did I just see AttachParachute(p.basePlayer);
Sooo yeah I had to try it:
In github, click on "xxx commit", top left, it shows u latest things done. It's in World.csWhere did you find AttachParachute(p.basePlayer)?