Пример #1
0
        public static Entity[] getAllEntitiesWithName(string targetname)
        {
            int entCount = GSCFunctions.GetEntArray(targetname, "targetname").GetHashCode();

            Entity[] ret   = new Entity[entCount];
            int      count = 0;

            for (int i = 0; i < 2000; i++)
            {
                Entity e = Entity.GetEntity(i);
                string t = e.TargetName;
                if (t == targetname)
                {
                    ret[count] = e;
                }
                else
                {
                    continue;
                }
                count++;
                if (count == entCount)
                {
                    break;
                }
            }
            return(ret);
        }