Exemple #1
0
 public void OnDisconnect(DisconnectEvent ev)
 {
     for (int i = eventQue.Count - 1; i > -1; i--)
     {
         if (eventQue[i].ev.Player.IpAddress == ev.Connection.IpAddress)
         {
             DeathSync d = eventQue[i];
             d.skip      = true;
             eventQue[i] = d;
             plugin.Info(ev.Connection.IpAddress + " escaped the resurection by disconnecting! Hopefully crash averted.");
         }
     }
 }
Exemple #2
0
        private void ZombieResurectCallback(object o)
        {
            ((Timer)o).Dispose();
            DeathSync dev = eventQue[0];

            eventQue.RemoveAt(0);
            if (dev.skip)
            {
                return;
            }
            PlayerDeathEvent ev = dev.ev;
            int role_i          = plugin.GetConfigInt("zombi_role");

            if (dev.valid)
            {
                if (ev.DamageTypeVar == DamageType.WALL || ev.DamageTypeVar == DamageType.TESLA || ev.DamageTypeVar == DamageType.LURE || ev.DamageTypeVar == DamageType.DECONT) //check damage types that might get player stuck.
                {
                    //Thesse are to check what level of the map is disabled.
                    //If player dies in a way that is deemed problematic (makes the player stuck) then we want to respawn at normal habitat.
                    int cls = ZombieClassify(role_i);
                    if (cls < 2 && plugin.Server.Map.WarheadDetonated)
                    {
                        return;
                    }
                    if (cls < 1 && plugin.Server.Map.LCZDecontaminated)
                    {
                        return;
                    }
                    ev.Player.ChangeRole((Role)role_i, true, true, true, true);
                }
                else
                {
                    ev.Player.ChangeRole((Role)role_i, true, false, true, true);
                }
            }
        }