void OnPlayerTakeDamage(PlayerSession session, EntityEffectSourceData dataSource)
{
if (session == null || dataSource == null)
{
return;
}
else
{
EntityStats stats = session.WorldPlayerEntity.GetComponent<EntityStats>();
string name = session.Name;
string tmpName = GetNameOfObject(dataSource.EntitySource);
if (tmpName != string.Empty && !tmpName.Contains("Creatures"))
{
string KillerName = tmpName.Remove(tmpName.Length - 3);
Clan myClan = getClan(session);
if (myClan != null && myClan.clanff == 0)
{
List<PlayerSession> clanSessions = getMembersOnline_byClan(myClan);
foreach (PlayerSession ses in clanSessions)
{
if (ses.Name == KillerName && ses.Name != session.Name)
{
dataSource.Value = 0;
Singleton<AlertManager>.Instance.GenericTextNotificationServer("Do not hurt your teammate!", getSession(KillerName).Player);
return;
}
}
}
return;
}
return;
}
}