Ejemplo n.º 1
0
 private void RestrictCommands(ZoneProps zone, Player player)
 {
     foreach (string cmd in zone.blockedCommands)
     {
         player.RestrictCommand(cmd);
     }
 }
Ejemplo n.º 2
0
        private void StartRadiationListener(Player player, ZoneProps zone)
        {
            var timer = RadiationListener[player] = new Timer();

            timer.Interval  = zone.radiationInterval;
            timer.AutoReset = true;
            timer.Enabled   = true;
            timer.Elapsed  += (x, y) =>
            {
                player.AddRads(zone.radiationAmount);
            };
        }
Ejemplo n.º 3
0
 private void OnEntityDeployed(Player player, Entity e, Player actualplacer)
 {
     if (e != null && !e.IsDestroyed)
     {
         ZoneProps nearbyzone = GetZoneAtLocation(actualplacer.Location) ?? null;
         if (nearbyzone != null)
         {
             if (nearbyzone.blockBuilding)
             {
                 float radius = nearbyzone.radius;
                 float dist   = Vector3.Distance(actualplacer.Location, util.ConvertStringToVector3(nearbyzone.location));
                 if (dist < radius)
                 {
                     e.Destroy();
                     player.MessageFrom(chat_Name, color_red + $"You are not allowed to build inside zone '{nearbyzone.name}'");
                 }
             }
         }
     }
 }