public override void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { base.OnZoneTrespass(playerInfo, action, sender, tresspassLocation, tresspassPercentage, trespassState); Output.Information("{0}: SoldierName:{1} Action:{2} Level:{3} Uid:{4} ZoneInclusive:{5} Location:({6},{7},{8}) Percentage:{9} State:{10}", "OnZoneTrespass", playerInfo.SoldierName, action, sender.LevelFileName, sender.UID, sender.ZoneInclusive, tresspassLocation.X, tresspassLocation.Y, tresspassLocation.Z, tresspassPercentage, trespassState); foreach (var item in sender.Tags) { Output.Information("{0}: MapZone Tag:{1}", "OnZoneTrespass", item); } foreach (var item in sender.ZonePolygon) { Output.Information("{0}: MapZone Polygon:({1},{2},{3})", "OnZoneTrespass", item.X, item.Y, item.Z); } }
/// <summary> /// Fires when a player takes [ZoneAction] and [flTresspassPercentage] > 0.0F /// </summary> /// <param name="playerInfo">The PlayerInfo object procon has on the player.</param> /// <param name="action">The action the player has taken on the zone</param> /// <param name="sender">The mapzone object that has fired the event</param> /// <param name="tresspassLocation">The location, reported by the game, that the action has taken place</param> /// <param name="tresspassPercentage">The percentage (0.0F to 1.0F) that the circle created by the error radius (default 14m) that /// this player has tresspased on the zone at point [pntTresspassLocation].</param> /// <param name="trespassState">Additional information about the event. If the ZoneAction is Kill/Death then this object is type "Kill".</param> public virtual void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { }
private void MapGeometry_MapZoneTrespassed(CPlayerInfo cpiSoldier, ZoneAction action, MapZone sender, Point3D pntTresspassLocation, float flTresspassPercentage, object trespassState) { InvokeOnAllEnabled("OnZoneTrespass", new[] {cpiSoldier, action, sender, pntTresspassLocation, flTresspassPercentage, trespassState}); }
public override void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { base.OnZoneTrespass(playerInfo, action, sender, tresspassLocation, tresspassPercentage, trespassState); }
/// <summary> /// Fires when a player takes [ZoneAction] and [flTresspassPercentage] > 0.0F /// </summary> /// <param name="cpiSoldier">The PlayerInfo object procon has on the player.</param> /// <param name="action">The action the player has taken on the zone</param> /// <param name="sender">The mapzone object that has fired the event</param> /// <param name="pntTresspassLocation">The location, reported by the game, that the action has taken place</param> /// <param name="flTresspassPercentage">The percentage (0.0F to 1.0F) that the circle created by the error radius (default 14m) that /// this player has tresspased on the zone at point [pntTresspassLocation].</param> /// <param name="trespassState">Additional information about the event. If the ZoneAction is Kill/Death then this object is type "Kill".</param> public virtual void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { }
public void OnZoneTrespass(CPlayerInfo cpiSoldier, ZoneAction action, MapZone sender, Point3D pntTresspassLocation, float flTresspassPercentage, object trespassState) { if (flTresspassPercentage >= this.m_flMinimumTrespassError) { if (trespassState is Kill) { Kill trespassKill = (Kill)trespassState; // If the trespasser died within the zone (the killer does not need to be inside the zone) if (action == ZoneAction.Death) { if (trespassKill.IsSuicide == false) { // If the player was within the limit for base camping. // AND the player is not on the same team. if (trespassKill.Distance <= this.m_iMaximumDistanceForBaseCamping && trespassKill.Killer.TeamID != trespassKill.Victim.TeamID) { if (sender.Tags.Contains("EFAE_PROTECT_U.SARMY") == true) { // If the player was on U.S side // References: PRoCon.Core.CMap, PRoCon.Core.CTeamName if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.conquest.us", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectUsArmyKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } if (sender.Tags.Contains("EFAE_PROTECT_RUSSIANARMY") == true) { if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.conquest.ru", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectRussianArmyKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } if (sender.Tags.Contains("EFAE_PROTECT_NVA") == true) { if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.conquest.nva", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectNVArmyKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } if (sender.Tags.Contains("EFAE_PROTECT_ATTACKERS") == true) { if (String.Compare(this.GetTeamLocalizationKeyByTeamId(cpiSoldier.TeamID), "global.rush.attackers", true) == 0) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeProtectAttackersKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } } } } // If the trespasser killed another player while inside the zone (the victim does not need to be inside the zone) else if (action == ZoneAction.Kill) { if (sender.Tags.Contains("EFAE_ANTICAMPER_SNIPER") == true) { // If they used a sniper rifle to kill. // References: PRoCon.Core.Players.Items.Weapon, PRoCon.Core.Players.Items.DamageTypes, PRoCon.Core.Players.Items.WeaponDictionary if (this.GetWeaponDamageType(trespassKill.DamageType) == DamageTypes.SniperRifle) { this.KillPlayerWithMessage(trespassKill.Killer.SoldierName, this.m_strEfaeAntiCamperSniperKillMessage.Replace("%kn%", trespassKill.Killer.SoldierName).Replace("%vn%", trespassKill.Victim.SoldierName)); } } } } } }
public void OnZoneTrespass(CPlayerInfo cpiSoldier, ZoneAction action, MapZone sender, Point3D pntTresspassLocation, float flTresspassPercentage) { }
public override void OnZoneTrespass(CPlayerInfo playerInfo, ZoneAction action, MapZone sender, Point3D tresspassLocation, float tresspassPercentage, object trespassState) { Output.TraceInformation("OnZoneTrespass {0} {1}", playerInfo.SoldierName, action, sender.LevelFileName); }