Results 1 to 4 of 4
  1. #1
    mwxplayer's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    hax
    Posts
    584
    Reputation
    10
    Thanks
    2,665
    My Mood
    Doh

    IW5M MapEdit (With Replacing Model Support!)

    1)Download The Script (DLL)
    2)Create a File Called "model.txt" in your IW5M Folder
    3)Place The model Name in "Model.txt"
    4)I hope so you all know How to Do mapedits (and I just edited this to replace Models)
    5)Run your Dedicated Server

    Note : if you don't make a file Called "model.txt" in your game folder then this Script won't work.







     
    Code:
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System****;
    using InfinityScript;
    
    namespace DUKIP
    {
        public class MapEdit : BaseScript
        {
            private Entity _airdropCollision;
            private Random _rng = new Random();
            private string _mapname;
            public MapEdit()
                : base()
            {
                Entity care_package = Call<Entity>("getent", "care_package", "targetname");
                _airdropCollision = Call<Entity>("getent", care_package.GetField<string>("target"), "targetname");
                _mapname = Call<string>("getdvar", "mapname");
                Call("precachemodel", getAlliesFlagModel(_mapname));
                Call("precachemodel", getAxisFlagModel(_mapname));
                Call("precachemodel", "prop_flag_neutral");
                Call("precacheshader", "waypoint_flag_friendly");
                Call("precacheshader", "compass_waypoint_target");
                Call("precacheshader", "compass_waypoint_bomb");
                Call("precachemodel", "weapon_scavenger_grenadebag");
                Call("precachemodel", "weapon_oma_pack");
                //Call("setdvar", "mapedit_allowcheats", "1");
    
                if (File.Exists("scripts\\maps\\" + _mapname + ".txt"))
                    loadMapEdit(_mapname);
    
                PlayerConnected += new Action<Entity>(player =>
                {
                    if (Call<int>("getdvarint", "mapedit_allowcheats") == 1 && (player.GetField<string>("name") == "TheApadayo" || player.GetField<string>("name") == "DidUknowiPwn"))
                        player.Call("notifyonplayercommand", "fly", "+frag");
                    player.SetField("attackeddoor", 0); // debounce timer
                    player.SetField("repairsleft", 0); // door repairs remaining
    
                    // usable notifications
                    player.Call("notifyonplayercommand", "triggeruse", "+activate");
                    player.OnNotify("triggeruse", (ent) => HandleUseables(player));
    
                    UsablesHud(player);
                    player.OnNotify("fly", (ent) =>
                    {
                        if (player.GetField<string>("sessionstate") != "spectator")
                        {
                            player.Call("allowspectateteam", "freelook", true);
                            player.SetField("sessionstate", "spectator");
                            player.Call("setcontents", 0);
                        }
                        else
                        {
                            player.Call("allowspectateteam", "freelook", false);
                            player.SetField("sessionstate", "playing");
                            player.Call("setcontents", 100);
                        }
                    });
                });
            }
    
            public override void OnSay(Entity player, string name, string message)
            {
                if (Call<int>("getdvarint", "mapedit_allowcheats") != 1)
                    return;
                // stop idiots from cheating
                string[] commands = { "viewpos", "cash", "credits", "player", "zombie" };
                /* if (commands.Contains(message) && !(player.GetField<string>("name") == "TheApadayo" || player.GetField<string>("name") == "DidUknowiPwn"))
                 {
                     player.Call("iprintlnbold", "Stop Cheating Idiot...");
                     return;
                 }*/
    
                switch (message)
                {
                    case "viewpos":
                        print("({0}, {1}, {2})", player.Origin.X, player.Origin.Y, player.Origin.Z);
                        break;
                    case "cash":
                        player.SetField("cash", player.GetField<int>("cash") + 500);
                        break;
                    case "credits":
                        player.SetField("credits", player.GetField<int>("credits") + 500);
                        break;
                    case "player":
                        player.SetField("team", "allies");
                        player.SetField("sessionteam", "allies");
                        break;
                    case "zombie":
                        player.SetField("team", "axis");
                        player.SetField("sessionteam", "axis");
                        break;
                }
                if (message.StartsWith("sound"))
                {
                    player.Call("playlocalsound", message.Split(' ')[1]);
                }
                if (message.StartsWith("model"))
                {
                    Call("precachemodel", message.Split(' ')[1]);
                    Entity ent = Call<Entity>("spawn", "script_model", new Parameter(player.Origin));
                    ent.Call("setmodel", message.Split(' ')[1]);
                    ent.SetField("angles", new Parameter(player.GetField<Vector3>("angles")));
                }
                /*if (message.StartsWith("health"))
                {
                    player.Call("iprintlnbold", "Health is at: ^1" + player.Health + "^0/^1" + player.GetField<int>("maxhp"));
                }*/
            }
    
            public void CreateRamp(Vector3 top, Vector3 bottom)
            {
                float distance = top.DistanceTo(bottom);
                int blocks = (int)Math.Ceiling(distance / 30);
                Vector3 A = new Vector3((top.X - bottom.X) / blocks, (top.Y - bottom.Y) / blocks, (top.Z - bottom.Z) / blocks);
                Vector3 temp = Call<Vector3>("vectortoangles", new Parameter(top - bottom));
                Vector3 BA = new Vector3(temp.Z, temp.Y + 90, temp.X);
                for (int b = 0; b <= blocks; b++)
                {
                    spawnCrate(bottom + (A * b), BA);
                }
            }
    
            public static List<Entity> usables = new List<Entity>();
            public void HandleUseables(Entity player)
            {
                foreach (Entity ent in usables)
                {
                    if (player.Origin.DistanceTo(ent.Origin) < ent.GetField<int>("range"))
                    {
                        switch (ent.GetField<string>("usabletype"))
                        {
                            case "door":
                                usedDoor(ent, player);
                                break;
                            default:
                                break;
                        }
                    }
                }
            }
    
            public static void runOnUsable(Func<Entity, bool> func, string type)
            {
                foreach (Entity ent in usables)
                {
                    if (ent.GetField<string>("usabletype") == type)
                    {
                        func.Invoke(ent);
                    }
                }
            }
    
            public static void notifyUsables(string notify)
            {
                foreach (Entity usable in usables)
                {
                    usable.Notify(notify);
                }
            }
    
            public void UsablesHud(Entity player)
            {
                HudElem message = HudElem.CreateFontString(player, "hudbig", 0.6f);
                message.SetPoint("CENTER", "CENTER", 0, -50);
                OnInterval(100, () =>
                {
                    bool _changed = false;
                    foreach (Entity ent in usables)
                    {
                        if (player.Origin.DistanceTo(ent.Origin) < ent.GetField<int>("range"))
                        {
                            switch (ent.GetField<string>("usabletype"))
                            {
                                case "door":
                                    message.SetText(getDoorText(ent, player));
                                    break;
                                default:
                                    message.SetText("");
                                    break;
                            }
                            _changed = true;
                        }
                    }
                    if (!_changed)
                    {
                        message.SetText("");
                    }
                    return true;
                });
            }
    
            public string getDoorText(Entity door, Entity player)
            {
                int hp = door.GetField<int>("hp");
                int maxhp = door.GetField<int>("maxhp");
                if (player.GetField<string>("sessionteam") == "allies")
                {
                    switch (door.GetField<string>("state"))
                    {
                        case "open":
                            if (player.CurrentWeapon == "defaultweapon_mp")
                                return "Door is Open. Press ^3[{+activate}] ^7to repair it. (" + hp + "/" + maxhp + ")";
                            return "Door is Open. Press ^3[{+activate}] ^7to close it. (" + hp + "/" + maxhp + ")";
                        case "close":
                            if (player.CurrentWeapon == "defaultweapon_mp")
                                return "Door is Closed. Press ^3[{+activate}] ^7to repair it. (" + hp + "/" + maxhp + ")";
                            return "Door is Closed. Press ^3[{+activate}] ^7to open it. (" + hp + "/" + maxhp + ")";
                        case "broken":
                            if (player.CurrentWeapon == "defaultweapon_mp")
                                return "Door is Broken. Press ^3[{+activate}] ^7to repair it. (" + hp + "/" + maxhp + ")";
                            return "^1Door is Broken.";
                    }
                }
                else if (player.GetField<string>("sessionteam") == "axis")
                {
                    switch (door.GetField<string>("state"))
                    {
                        case "open":
                            return "Door is Open.";
                        case "close":
                            return "Press ^3[{+activate}] ^7to attack the door.";
                        case "broken":
                            return "^1Door is Broken";
                    }
                }
                return "";
            }
    
            public void MakeUsable(Entity ent, string type, int range)
            {
                ent.SetField("usabletype", type);
                ent.SetField("range", range);
                usables.Add(ent);
            }
    
            public void CreateDoor(Vector3 open, Vector3 close, Vector3 angle, int size, int height, int hp, int range)
            {
                double offset = (((size / 2) - 0.5) * -1);
                Entity center = Call<Entity>("spawn", "script_model", new Parameter(open));
                for (int j = 0; j < size; j++)
                {
                    Entity door = spawnCrate(open + (new Vector3(0, 30, 0) * (float)offset), new Vector3(0, 0, 0));
                    door.Call("setModel", "com_plasticcase_enemy");
                    door.Call("enablelinkto");
                    door.Call("linkto", center);
                    for (int h = 1; h < height; h++)
                    {
                        Entity door2 = spawnCrate(open + (new Vector3(0, 30, 0) * (float)offset) - (new Vector3(70, 0, 0) * h), new Vector3(0, 0, 0));
                        door2.Call("setModel", "com_plasticcase_enemy");
                        door2.Call("enablelinkto");
                        door2.Call("linkto", center);
                    }
                    offset += 1;
                }
                center.SetField("angles", new Parameter(angle));
                center.SetField("state", "open");
                center.SetField("hp", hp);
                center.SetField("maxhp", hp);
                center.SetField("open", new Parameter(open));
                center.SetField("close", new Parameter(close));
    
                MakeUsable(center, "door", range);
            }
    
            private void repairDoor(Entity door, Entity player)
            {
                if (player.GetField<int>("repairsleft") == 0) return; // no repairs left on weapon
    
                if (door.GetField<int>("hp") < door.GetField<int>("maxhp"))
                {
                    door.SetField("hp", door.GetField<int>("hp") + 1);
                    player.SetField("repairsleft", player.GetField<int>("repairsleft") - 1);
                    player.Call("iprintlnbold", "Repaired Door! (" + player.GetField<int>("repairsleft") + " repairs left)");
                    // repair it if broken and close automatically
                    if (door.GetField<string>("state") == "broken")
                    {
                        door.Call(33399, new Parameter(door.GetField<Vector3>("close")), 1); // moveto
                        AfterDelay(300, () =>
                        {
                            door.SetField("state", "close");
                        });
                    }
                }
                else
                {
                    player.Call("iprintlnbold", "Door has full health!");
                }
            }
    
            private void usedDoor(Entity door, Entity player)
            {
                if (!player.IsAlive) return;
                // has repair weapon. do repair door
                if (player.CurrentWeapon.Equals("defaultweapon_mp"))
                {
                    repairDoor(door, player);
                    return;
                }
                if (door.GetField<int>("hp") > 0)
                {
                    if (player.GetField<string>("sessionteam") == "allies")
                    {
                        if (door.GetField<string>("state") == "open")
                        {
                            door.Call(33399, new Parameter(door.GetField<Vector3>("close")), 1); // moveto
                            AfterDelay(300, () =>
                            {
                                door.SetField("state", "close");
                            });
                        }
                        else if (door.GetField<string>("state") == "close")
                        {
                            door.Call(33399, new Parameter(door.GetField<Vector3>("open")), 1); // moveto
                            AfterDelay(300, () =>
                            {
                                door.SetField("state", "open");
                            });
                        }
                    }
                    else if (player.GetField<string>("sessionteam") == "axis")
                    {
                        if (door.GetField<string>("state") == "close")
                        {
                            if (player.GetField<int>("attackeddoor") == 0)
                            {
                                int hitchance = 0;
                                switch (player.Call<string>("getstance"))
                                {
                                    case "prone":
                                        hitchance = 20;
                                        break;
                                    case "couch":
                                        hitchance = 45;
                                        break;
                                    case "stand":
                                        hitchance = 90;
                                        break;
                                    default:
                                        break;
                                }
                                if (_rng.Next(100) < hitchance)
                                {
                                    door.SetField("hp", door.GetField<int>("hp") - 1);
                                    player.Call("iprintlnbold", "HIT: " + door.GetField<int>("hp") + "/" + door.GetField<int>("maxhp"));
                                }
                                else
                                {
                                    player.Call("iprintlnbold", "^1MISS");
                                }
                                player.SetField("attackeddoor", 1);
                                player.AfterDelay(1000, (e) => player.SetField("attackeddoor", 0));
                            }
                        }
                    }
                }
                else if (door.GetField<int>("hp") == 0 && door.GetField<string>("state") != "broken")
                {
                    if (door.GetField<string>("state") == "close")
                        door.Call(33399, new Parameter(door.GetField<Vector3>("open")), 1f); // moveto
                    door.SetField("state", "broken");
                }
            }
    
            public Entity CreateWall(Vector3 start, Vector3 end)
            {
                float D = new Vector3(start.X, start.Y, 0).DistanceTo(new Vector3(end.X, end.Y, 0));
                float H = new Vector3(0, 0, start.Z).DistanceTo(new Vector3(0, 0, end.Z));
                int blocks = (int)Math****und(D / 55, 0);
                int height = (int)Math****und(H / 30, 0);
    
                Vector3 C = end - start;
                Vector3 A = new Vector3(C.X / blocks, C.Y / blocks, C.Z / height);
                float TXA = A.X / 4;
                float TYA = A.Y / 4;
                Vector3 angle = Call<Vector3>("vectortoangles", new Parameter(C));
                angle = new Vector3(0, angle.Y, 90);
                Entity center = Call<Entity>("spawn", "script_origin", new Parameter(new Vector3(
                    (start.X + end.X) / 2, (start.Y + end.Y) / 2, (start.Z + end.Z) / 2)));
                for (int h = 0; h < height; h++)
                {
                    Entity crate = spawnCrate((start + new Vector3(TXA, TYA, 10) + (new Vector3(0, 0, A.Z) * h)), angle);
                    crate.Call("enablelinkto");
                    crate.Call("linkto", center);
                    for (int i = 0; i < blocks; i++)
                    {
                        crate = spawnCrate(start + (new Vector3(A.X, A.Y, 0) * i) + new Vector3(0, 0, 10) + (new Vector3(0, 0, A.Z) * h), angle);
                        crate.Call("enablelinkto");
                        crate.Call("linkto", center);
                    }
                    crate = spawnCrate(new Vector3(end.X, end.Y, start.Z) + new Vector3(TXA * -1, TYA * -1, 10) + (new Vector3(0, 0, A.Z) * h), angle);
                    crate.Call("enablelinkto");
                    crate.Call("linkto", center);
                }
                return center;
            }
            public Entity CreateFloor(Vector3 corner1, Vector3 corner2)
            {
                float width = corner1.X - corner2.X;
                if (width < 0) width = width * -1;
                float length = corner1.Y - corner2.Y;
                if (length < 0) length = length * -1;
    
                int bwide = (int)Math****und(width / 50, 0);
                int blength = (int)Math****und(length / 30, 0);
                Vector3 C = corner2 - corner1;
                Vector3 A = new Vector3(C.X / bwide, C.Y / blength, 0);
                Entity center = Call<Entity>("spawn", "script_origin", new Parameter(new Vector3(
                    (corner1.X + corner2.X) / 2, (corner1.Y + corner2.Y) / 2, corner1.Z)));
                for (int i = 0; i < bwide; i++)
                {
                    for (int j = 0; j < blength; j++)
                    {
                        Entity crate = spawnCrate(corner1 + (new Vector3(A.X, 0, 0) * i) + (new Vector3(0, A.Y, 0) * j), new Vector3(0, 0, 0));
                        crate.Call("enablelinkto");
                        crate.Call("linkto", center);
                    }
                }
                return center;
            }
    
            private int _flagCount = 0;
    
            public void CreateElevator(Vector3 enter, Vector3 exit)
            {
                Entity flag = Call<Entity>("spawn", "script_model", new Parameter(enter));
                flag.Call("setModel", getAlliesFlagModel(_mapname));
                Entity flag2 = Call<Entity>("spawn", "script_model", new Parameter(exit));
                flag2.Call("setModel", getAxisFlagModel(_mapname));
    
                int curObjID = 31 - _flagCount++;
                Call(431, curObjID, "active"); // objective_add
                Call(435, curObjID, new Parameter(flag.Origin)); // objective_position
                Call(434, curObjID, "compass_waypoint_bomb"); // objective_icon
    
                OnInterval(100, () =>
                {
                    foreach (Entity player in getPlayers())
                    {
                        if (player.Origin.DistanceTo(enter) <= 50)
                        {
                            player.Call("setorigin", new Parameter(exit));
                        }
                    }
                    return true;
                });
            }
    
            public void CreateHiddenTP(Vector3 enter, Vector3 exit)
            {
                Entity flag = Call<Entity>("spawn", "script_model", new Parameter(enter));
                flag.Call("setModel", "weapon_scavenger_grenadebag");
                Entity flag2 = Call<Entity>("spawn", "script_model", new Parameter(exit));
                flag2.Call("setModel", "weapon_oma_pack");
                OnInterval(100, () =>
                {
                    foreach (Entity player in getPlayers())
                    {
                        if (player.Origin.DistanceTo(enter) <= 50)
                        {
                            player.Call("setorigin", new Parameter(exit));
                        }
                    }
                    return true;
                });
            }
    
            // maybe someday
            /*private void realElevator(Vector3 bottom, Vector3 top)
            {
                Entity center = Call<Entity>("spawn", "script_origin", new Parameter(bottom));
                Entity floor = CreateFloor(new Vector3(bottom.X - 200, bottom.Y - 150, bottom.Z),
                    new Vector3(bottom.X + 200, bottom.Y + 150, bottom.Z));
                floor.Call("enablelinkto");
                floor.Call("linkto", center);
                Entity cieling = CreateFloor(new Vector3(bottom.X - 200, bottom.Y - 150, bottom.Z),
                    new Vector3(bottom.X + 200, bottom.Y + 150, bottom.Z + 300));
                cieling.Call("enablelinkto");
                cieling.Call("linkto", center);
            }*/
    
            public Entity spawnModel(string model, Vector3 origin, Vector3 angles)
            {
                Entity ent = Call<Entity>("spawn", "script_model", new Parameter(origin));
                ent.Call("setmodel", model);
                ent.SetField("angles", new Parameter(angles));
                return ent;
            }
    
            
            public Entity spawnCrate(Vector3 origin, Vector3 angles)
            {
                Entity ent = Call<Entity>("spawn", "script_model", new Parameter(origin));
    
                StreamReader sr = new StreamReader("model.txt");
               var read = sr.ReadLine();
                
                ent.Call("setmodel", read);
                sr.Close();
              
    
                ent.SetField("angles", new Parameter(angles));
                ent.Call(33353, _airdropCollision); // clonebrushmodeltoscriptmodel
                return ent;
            }
            public Entity[] getSpawns(string name)
            {
                return Call<Entity[]>("getentarray", name, "classname");
            }
            public void removeSpawn(Entity spawn)
            {
                spawn.Call("delete");
            }
            public void createSpawn(string type, Vector3 origin, Vector3 angle)
            {
                Entity spawn = Call<Entity>("spawn", type, new Parameter(origin));
                spawn.SetField("angles", new Parameter(angle));
            }
    
            private static void print(string format, params object[] p)
            {
                Log.Write(LogLevel.All, format, p);
            }
    
            private void loadMapEdit(string mapname)
            {
                try
                {
                    StreamReader map = new StreamReader("scripts\\maps\\" + mapname + ".txt");
                    while (!map.EndOfStream)
                    {
                        string line = map.ReadLine();
                        if (line.StartsWith("//") || line.Equals(string.Empty))
                        {
                            continue;
                        }
                        string[] split = line.Split(':');
                        if (split.Length < 1)
                        {
                            continue;
                        }
                        string type = split[0];
                        switch (type)
                        {
                            case "crate":
                                split = split[1].Split(';');
                                if (split.Length < 2) continue;
                                spawnCrate(parseVec3(split[0]), parseVec3(split[1]));
                                break;
                            case "ramp":
                                split = split[1].Split(';');
                                if (split.Length < 2) continue;
                                CreateRamp(parseVec3(split[0]), parseVec3(split[1]));
                                break;
                            case "elevator":
                                split = split[1].Split(';');
                                if (split.Length < 2) continue;
                                CreateElevator(parseVec3(split[0]), parseVec3(split[1]));
                                break;
                            case "HiddenTP":
                                split = split[1].Split(';');
                                if (split.Length < 2) continue;
                                CreateHiddenTP(parseVec3(split[0]), parseVec3(split[1]));
                                break;
                            case "door":
                                split = split[1].Split(';');
                                if (split.Length < 7) continue;
                                CreateDoor(parseVec3(split[0]), parseVec3(split[1]), parseVec3(split[2]), int.Parse(split[3]), int.Parse(split[4]), int.Parse(split[5]), int.Parse(split[6]));
                                break;
                            case "wall":
                                split = split[1].Split(';');
                                if (split.Length < 2) continue;
                                CreateWall(parseVec3(split[0]), parseVec3(split[1]));
                                break;
                            case "floor":
                                split = split[1].Split(';');
                                if (split.Length < 2) continue;
                                CreateFloor(parseVec3(split[0]), parseVec3(split[1]));
                                break;
                            /*case "realelevator":
                                split = split[1].Split(';');
                                if (split.Length < 2) continue;
                                realElevator(parseVec3(split[0]), parseVec3(split[1]));
                                break;*/
                            case "model":
                                split = split[1].Split(';');
                                if (split.Length < 3) continue;
                                spawnModel(split[0], parseVec3(split[1]), parseVec3(split[2]));
                                break;
                            default:
                                print("Unknown MapEdit Entry {0}... ignoring", type);
                                break;
                        }
                    }
                }
                catch (Exception e)
                {
                    print("error loading mapedit for map {0}: {1}", mapname, e.Message);
                }
            }
    
            private Vector3 parseVec3(string vec3)
            {
                vec3 = vec3.Replace(" ", string.Empty);
                if (!vec3.StartsWith("(") && !vec3.EndsWith(")")) throw new IOException("Malformed MapEdit File!");
                vec3 = vec3.Replace("(", string.Empty);
                vec3 = vec3.Replace(")", string.Empty);
                String[] split = vec3.Split(',');
                if (split.Length < 3) throw new IOException("Malformed MapEdit File!");
                return new Vector3(float.Parse(split[0]), float.Parse(split[1]), float.Parse(split[2]));
            }
    
            private string getAlliesFlagModel(string mapname)
            {
                switch (mapname)
                {
                    case "mp_alpha":
                    case "mp_dome":
                    case "mp_exchange":
                    case "mp_hardhat":
                    case "mp_interchange":
                    case "mp_lambeth":
                    case "mp_radar":
                    case "mp_cement":
                    case "mp_hillside_ss":
                    case "mp_morningwood":
                    case "mp_overwatch":
                    case "mp_park":
                    case "mp_qadeem":
                    case "mp_restrepo_ss":
                    case "mp_terminal_cls":
                    case "mp_roughneck":
                    case "mp_boardwalk":
                    case "mp_moab":
                    case "mp_nola":
                        return "prop_flag_delta";
                    case "mp_bootleg":
                    case "mp_bravo":
                    case "mp_carbon":
                    case "mp_mogadishu":
                    case "mp_village":
                    case "mp_shipbreaker":
                        return "prop_flag_pmc";
                    case "mp_paris":
                        return "prop_flag_gign";
                    case "mp_plaza2":
                    case "mp_seatown":
                    case "mp_underground":
                    case "mp_aground_ss":
                    case "mp_courtyard_ss":
                    case "mp_italy":
                    case "mp_meteora":
                        return "prop_flag_sas";
                }
                return "";
            }
            private string getAxisFlagModel(string mapname)
            {
                switch (mapname)
                {
                    case "mp_alpha":
                    case "mp_bootleg":
                    case "mp_dome":
                    case "mp_exchange":
                    case "mp_hardhat":
                    case "mp_interchange":
                    case "mp_lambeth":
                    case "mp_paris":
                    case "mp_plaza2":
                    case "mp_radar":
                    case "mp_underground":
                    case "mp_cement":
                    case "mp_hillside_ss":
                    case "mp_overwatch":
                    case "mp_park":
                    case "mp_restrepo_ss":
                    case "mp_terminal_cls":
                    case "mp_roughneck":
                    case "mp_boardwalk":
                    case "mp_moab":
                    case "mp_nola":
                        return "prop_flag_speznas";
                    case "mp_bravo":
                    case "mp_carbon":
                    case "mp_mogadishu":
                    case "mp_village":
                    case "mp_shipbreaker":
                        return "prop_flag_africa";
                    case "mp_seatown":
                    case "mp_aground_ss":
                    case "mp_courtyard_ss":
                    case "mp_meteora":
                    case "mp_morningwood":
                    case "mp_qadeem":
                    case "mp_italy":
                        return "prop_flag_ic";
                }
                return "";
            }
    
            private Entity[] getPlayers()
            {
                List<Entity> players = new List<Entity>();
                for (int i = 0; i < 17; i++)
                {
                    Entity entity = Call<Entity>("getentbynum", i);
                    if (entity != null)
                    {
                        if (entity.IsPlayer)
                        {
                            players.Add(entity);
                        }
                    }
                }
                return players.ToArray();
            }
        }
    }

    a list of Models for Dome Can be Found Here :
    Code:
    com_fire_extinguisher_des
    fx_paper_sheet02
    fx_paper_sheet01
    com_copypaper_box_lid
    com_copypaper_box_open
    com_plasticcase_green_big_us_dirt
    com_bomb_objective_d
    com_bomb_objective
    mil_tntbomb_mp
    com_plasticcase_beige_big
    com_laptop_2_open
    com_cellphone_on
    machinery_oxygen_tank02
    machinery_windmill
    com_ex_airconditioner
    com_barrel_benzin
    com_pipe_8x96_gas
    com_pipe_4x64_metal
    me_electricbox4
    com_pipe_8x128_metal
    com_pipe_4x96_metal
    com_pipe_4x128_gas
    fence_tarp_130x56
    fence_tarp_107x56
    fence_tarp_151x56
    fence_tarp_134x56
    fence_tarp_140x56
    fence_tarp_167x56
    fence_tarp_134x76
    vehicle_hummer_destructible
    foliage_pacific_bushtree01_animated
    foliage_desertbrush_3_animated
    foliage_pacific_flowers06_animated
    oil_pump_jack01
    oil_pump_jack02
    accessories_windsock_large
    foliage_bush_big
    foliage_desertbrush_1
    foliage_desertbrush_2
    foliage_desertbrush_3
    foliage_drygrass_squareclump
    foliage_pacific_brush01
    foliage_pacific_flowers06
    foliage_grass_lowline
    foliage_pacific_bushtree01
    com_cardboardboxshortclosed_dusty_2
    com_cardboardbox_dusty_04
    com_cardboardbox_dusty_05
    com_paintcan_dusty
    com_propane_tank_dusty
    ch_furniture_teachers_desk_dusty_1
    com_restaurantchair_dusty_1
    com_masking_tape_black_dusty_1
    com_masking_tape_tan_dusty_1
    com_masking_tape_black_dusty_2
    com_masking_tape_tan_dusty_2
    com_wire_spool_green_dusty_1
    com_wire_spool_green_dusty_2
    com_wire_spool_beige_dusty_1
    com_wire_spool_beige_dusty_2
    com_wire_spool_red_dusty_1
    com_wire_spool_red_dusty_2
    com_flashlight_off_dusty
    cliffhanger_quonset_black_wires_outside_left
    paris_catacombs_wire_red_02
    paris_catacombs_wire_red_03
    paris_catacombs_wire_red_04
    paris_catacombs_wire_red_05
    ch_industrial_light_01_off
    com_pail_metal1
    ch_rubble_chunk02
    ch_rubble_chunk02_alt
    icbm_electronic_cabinet2
    icbm_electronic_cabinet3
    icbm_electronic_cabinet4
    icbm_electronic_cabinet5
    icbm_electronic_cabinet6
    com_security_camera
    com_barrel_white_rust
    com_barrel_blue_rust
    metal_hanging_strips_med_01
    metal_hanging_strips_sml_01
    com_wooden_pallet
    berlin_hesco_barrier_med
    aftermath_rebar_group_01_50_scale
    aftermath_rebar_group_02_50_scale
    me_ac_big
    ch_mattress_bent_2
    me_cargocontainersingleface
    me_cargocontainersingleface_green
    me_cargocontainersingleface_white
    me_chainlink_fence_pole
    me_chainlink_fence_pole2
    com_conference_table2
    com_electrical_pipe
    com_floodlight_blue_on
    ch_furniture_teachers_desk1
    com_pipe_4_90angle_gas
    com_pipe_4_coupling_gas
    com_pipe_8_fit_gas
    com_pipe_8_90angle_gas
    com_pipe_coupling_gas
    com_wallchunk_rebar02
    com_satellite_dish_big
    me_satellitedish
    com_steel_ladder2
    com_steel_ladder_top
    bc_military_comm_tower
    com_water_tower
    cs_cargoship_wall_light_off
    com_barrel_fire
    com_restaurantchair_1
    trash_can4
    com_copypaper
    ch_corkboard_metaltrim_4x8
    prop_electric_box
    icbm_electronic_cabinet1
    icbm_electronic_cabinet2_busted
    icbm_electronic_cabinet3_busted
    icbm_electronic_cabinet4_busted
    icbm_electronic_cabinet7_busted
    icbm_electronic_cabinet8_busted
    icbm_electronic_cabinet1_busted
    icbm_electronic_cabinet6_busted
    icbm_electronic_cabinet5_busted
    ch_icbm_screen_bust
    ch_icbm_screen_bust1
    ch_icbm_screen_bust2
    com_pallet
    com_pallet_2
    com_pallet_stack
    trash_bottle_water2
    trash_cigarettes
    trash_fries1
    trash_styrofoam_container5
    trash_wrapper1
    com_two_light_fixture_off
    ctl_small_rocks_03
    ctl_small_rocks_01
    ctl_small_rocks_02
    ctl_small_rocks_05
    ch_bunker_door_hinge
    usa_sign_donotenter
    ap_table_piece_small_destroyed
    ap_table_destroyed_01
    ap_table_piece_big_destroyed
    ny_manhattan_building_electricalboxunit_a
    vehicle_m1a1_abrams_dmg
    ch_campfire_largekettle
    com_metal_briefcase
    vehicle_semi_truck_trailer
    com_plasticcase_green_rifle
    machinery_cable_spool1
    machinery_cable_spool2
    machinery_cable_spool3
    pipes_metal_horiz_128_brick_big_brown
    pipes_metal01_plaster_tan
    pipes_metal02_plaster_tan
    pipes_metal_vert02_plaster_tan
    pipes_metal_vert02_plaster_white
    com_flashlight_off
    ch_icbm_console_busted
    com_airduct_square_dull
    com_airduct_s_90_dull
    com_airduct_s_short_dull
    com_airduct_c_vent_dull
    com_pipe_8_90angle_metal
    com_pipe_coupling_metal
    com_pipe_4_90angle_metal
    com_airduct_s_holder
    food_soda_single02
    com_barrel_blue
    com_hand_radio
    com_studiolight_hanging_off
    com_barrel_black
    icbm_electricpanel2
    com_airduct_02dlc
    subway_concrete_pillar_2_end_02
    com_plasticcase_green_big
    vehicle_forklift
    com_airduct_01
    ,weapon_us_smoke_grenade_burnt
    com_steel_rails_long
    com_steel_rails_med
    com_steel_rails_short
    gulag_floorwires
    com_restaurantsteelshelf_rusty_02
    com_restaurantsteelshelf_rusty_01
    cs_iron_wire
    mil_razorwire_long_static
    machinery_radome_cage
    utility_checkpoint_gate_up
    com_debris_paper
    foliage_shrub_desertspikey2_flag
    foliage_grass_tuft_tallnarrow_yellow_flag
    machinery_radome_cloth_animated
    machinery_car_battery_old
    ch_bulletinpaperdecals_1
    brokenglass_pile02
    brokenglass_pile02_planes
    brokenglass_pile03
    brokenglass_pile03_planes
    brokenglass_pile05
    brokenglass_pile06
    brokenglass_pile09
    brokenglass_pile09_planes
    brokenglass_window01
    brokenglass_window02
    brokenglass_window03
    brokenglass_pile01
    brokenglass_pile04
    brokenglass_pile01_planes
    brokenglass_pile08
    brokenglass_pile08_planes
    me_plastic_crate1
    com_soup_can
    com_bottle1
    com_barrel_shard3
    com_bottle2
    com_junktire2
    ex_picture_cat_01
    com_red_toolbox_dusty
    com_spray_can01
    com_spray_can02
    com_soup_can_dusty
    me_plastic_crate2
    me_plastic_crate3
    com_fire_extinguisher_dusty
    com_copypaper_box
    com_teddy_bear
    com_barrel_shard4
    com_cardboardbox05
    com_junktire
    com_bottle3
    com_trash_bin_sml01
    com_clipboard_wpaper
    mp_body_delta_elite_assault_aa
    head_delta_elite_a
    head_delta_elite_b
    head_delta_elite_d
    viewhands_delta
    mp_body_delta_elite_assault_ab
    head_delta_elite_c
    mp_body_delta_elite_assault_ba
    mp_body_delta_elite_assault_bb
    mp_body_delta_elite_lmg_a
    mp_body_delta_elite_lmg_b
    mp_body_delta_elite_shotgun_a
    mp_body_delta_elite_smg_a
    mp_body_delta_elite_smg_b
    mp_body_ally_delta_sniper
    head_ally_delta_sniper
    com_plasticcase_delta
    prop_flag_delta
    prop_flag_delta_carry
    mp_body_russian_military_assault_a
    head_russian_military_aa
    viewhands_russian_a
    mp_body_russian_military_lmg_a
    head_russian_military_b
    mp_body_russian_military_shotgun_a
    head_russian_military_dd
    mp_body_russian_military_smg_a
    head_russian_military_f
    mp_body_opforce_russian_urban_sniper
    head_opforce_russian_urban_sniper
    viewhands_op_force
    com_plasticcase_ussr
    prop_flag_speznas
    prop_flag_speznas_carry
    mp_body_ally_ghillie_desert_sniper
    viewhands_iw5_ghillie_desert
    mp_body_opforce_ghillie_desert_sniper
    head_opforce_russian_air_sniper
    ac_car_part01
    ac_car_part02
    ac_car_part03
    ac_car_part04
    ac_car_part05
    ac_car_part06
    ac_car_part07
    ,fx_metal_piece02_distant
    vehicle_btr80_d_hatch1
    vehicle_btr80_d_hatch2
    vehicle_btr80_d_wheel
    fx_paper_sheet02_burn
    fx_paper_sheet01_burn
    fx_mail_03
    ,fx_me_brick_01_piece01
    ,fx_me_brick_01_piece02
    com_plasticcase_seals
    com_ex_airconditioner_dam
    com_ex_airconditioner_fan
    com_ex_airconditioner_grating
    me_electricbox4_dest
    me_electricbox4_door
    machinery_oxygen_tank01_dam
    machinery_oxygen_tank02_dam
    machinery_oxygen_tank01_des
    machinery_oxygen_tank02_des
    machinery_oxygen_tank01_des_top
    machinery_oxygen_tank02_des_top
    machinery_oxygen_tank01_des_bot
    machinery_oxygen_tank02_des_bot
    machinery_oxygen_tank01_cap
    machinery_oxygen_tank02_cap
    vehicle_hummer_destroyed
    vehicle_hummer_destroyed_wheel
    vehicle_hummer_destroyed_door
    ,fx_glass_piece_large_03
    ,fx_glass_piece_large_01
    ,fx_glass_piece_large_02
    ,fx_glass_piece01
    ,fx_glass_piece02
    com_barrel_piece
    com_barrel_piece2
    ,fx_rock_small


    Credits : DiduKnowiPwn,TheApadayo,me (Just for Editing Spawn Crate Entity)
    Attached Thumbnails Attached Thumbnails
    H66GA.jpg  

    txoPW.jpg  

    Gn7eL.jpg  

    <b>Downloadable Files</b> Downloadable Files
    Last edited by mwxplayer; 12-07-2012 at 10:08 AM.

  2. The Following 16 Users Say Thank You to mwxplayer For This Useful Post:

    -GodOfWar- (04-28-2013),2000callum (05-15-2013),anal.yse (05-10-2013),CaptainLuis41 (07-03-2014),Combine24 (12-08-2013),hacktaodachethet (12-08-2012),HardcoreZmeer (06-08-2013),iMCSx (04-21-2013),leidermann93 (03-22-2016),pikach (12-25-2012),SpiderHacks (09-16-2014),Tarakakys (06-28-2014),urdead1234321 (12-08-2012),wildkillerr (12-07-2012),xPeks (02-22-2014),zhorakrnev (02-24-2014)

  3. #2
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,883
    My Mood
    Psychedelic
    Should've added the models for each map...

  4. #3
    mwxplayer's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    hax
    Posts
    584
    Reputation
    10
    Thanks
    2,665
    My Mood
    Doh
    Quote Originally Posted by Kenshin13 View Post
    Should've added the models for each map...
    too lazy. btw you can find them in FD1 IW5M->Scripts Development

  5. #4
    hacktaodachethet's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Location
    China
    Posts
    58
    Reputation
    10
    Thanks
    2
    My Mood
    Angry
    nice work, i've played in a sever use map edit for infected mode before, and its freaky insane xD

Similar Threads

  1. I need help with a model-swap mod.
    By pumabarf in forum Combat Arms Mod Discussion
    Replies: 3
    Last Post: 08-06-2010, 05:19 PM
  2. Help with hack (No support on FTG Forum)
    By cynicz in forum General
    Replies: 2
    Last Post: 02-28-2010, 02:08 AM
  3. help with gun model switch
    By Jarppi in forum Combat Arms Mod Discussion
    Replies: 0
    Last Post: 02-09-2010, 07:21 PM
  4. [Request] G36KE Or G36C With No Model Size Changed
    By DannyVaj in forum Combat Arms Mod Discussion
    Replies: 3
    Last Post: 01-13-2010, 11:25 PM
  5. What does replacing models do?
    By Venturo London in forum Combat Arms Mod Discussion
    Replies: 6
    Last Post: 12-05-2009, 07:59 PM