Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    farmerrich's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0

    Lightbulb MW3 CARE PACKAGE BUNKERS.

    Is it possible to have a Care Package bunker mod, or tutorial , because on iw5m TG clan and Z00mby clan have them.

    check this out and youll see what I mean
    Last edited by Jorndel; 01-12-2013 at 11:30 PM.

  2. #2
    mwxplayer's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    hax
    Posts
    584
    Reputation
    10
    Thanks
    2,663
    My Mood
    Doh
    LEARN TO CODE...!

  3. #3
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,539
    My Mood
    Angelic
    Quote Originally Posted by mwxplayer View Post
    LEARN TO CODE...!
    Learn to read. And learn 2 code yourself X,x

    This thread is advertising, and if you didn't know that then...



    Nope, no idea what it is, nor do I want to know
    I would go back to MW2 for Zombie Bunkers

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  4. The Following User Says Thank You to Jorndel For This Useful Post:

    mwxplayer (12-23-2012)

  5. #4
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,876
    My Mood
    Psychedelic
    It's easy. You can use the MapEdit plugin for IW5M and just make a lot of walls, ramps etc.
    Or you can integrate that with your own plugin to make a bunker with much less code.
    (Define place, with, size, height.)

  6. #5
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,674
    Reputation
    905
    Thanks
    18,539
    My Mood
    Angelic
    Quote Originally Posted by Kenshin13 View Post
    It's easy. You can use the MapEdit plugin for IW5M and just make a lot of walls, ramps etc.
    Or you can integrate that with your own plugin to make a bunker with much less code.
    (Define place, with, size, height.)
    Guess what I just saw X,x

    It's MW3 not BO2.

    Silly me, please forgive me.
    I acted dumb

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  7. #6
    mwxplayer's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    hax
    Posts
    584
    Reputation
    10
    Thanks
    2,663
    My Mood
    Doh

  8. #7
    farmerrich's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Well, I appreciate this guys, Ive been active alot here, but just viewing as a user, also im only 13, I am starting to learn to code, forgive my noobishness, but nice to know you guys reply really quickly Also Kenshin, I love your work. (do you know anyone named tecn0logy , he was hacking in a iw5m tg zombies server , I asked him who coded the hack, he said you "privately coded" it. :P) Thanks again guys!

  9. #8
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,876
    My Mood
    Psychedelic
    Quote Originally Posted by farmerrich View Post
    Well, I appreciate this guys, Ive been active alot here, but just viewing as a user, also im only 13, I am starting to learn to code, forgive my noobishness, but nice to know you guys reply really quickly Also Kenshin, I love your work. (do you know anyone named tecn0logy , he was hacking in a iw5m tg zombies server , I asked him who coded the hack, he said you "privately coded" it. :P) Thanks again guys!
    Thanks
    LOL @mwxplayer <-- That was him.
    Wonder which one he used....

    Also, just a thought but, if you want, I could try to make a plugin to spawn bunkers if you harass me enough (y) Might forget which is why I said harass me.
    Last edited by Kenshin13; 12-23-2012 at 08:02 AM.

  10. The Following User Says Thank You to Kenshin13 For This Useful Post:

    mwxplayer (12-23-2012)

  11. #9
    mwxplayer's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    hax
    Posts
    584
    Reputation
    10
    Thanks
    2,663
    My Mood
    Doh
    Quote Originally Posted by Kenshin13 View Post
    Thanks
    LOL @mwxplayer <-- That was him.
    Wonder which one he used....

    Also, just a thought but, if you want, I could try to make a plugin to spawn bunkers if you harass me enough (y) Might forget which is why I said harass me.
    why would you even?
    http://www.mpgh.net/forum/594-call-d...l-support.html

  12. #10
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,876
    My Mood
    Psychedelic
    Quote Originally Posted by mwxplayer View Post
    To simplify the process in making a bunker.

  13. #11
    farmerrich's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Jordnel ! I forgot about you! i LOVE YOUR work aswell, also if mwxplayer was aimbotting on TG clan zombies server with bunkers on iw5wm .... I mightve been pissed off and told tg to ban/kick himm... ehhe ehehe.... Anyways.... well... kenshin. Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag1)
    Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag2) Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag3)Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag4)

  14. #12
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,473
    Reputation
    564
    Thanks
    5,876
    My Mood
    Psychedelic
    Quote Originally Posted by farmerrich View Post
    Jordnel ! I forgot about you! i LOVE YOUR work aswell, also if mwxplayer was aimbotting on TG clan zombies server with bunkers on iw5wm .... I mightve been pissed off and told tg to ban/kick himm... ehhe ehehe.... Anyways.... well... kenshin. Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag1)
    Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag2) Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag3)Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag4)
    Wall spamming me/PM spamming would do a better job.

  15. #13
    mwxplayer's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    hax
    Posts
    584
    Reputation
    10
    Thanks
    2,663
    My Mood
    Doh
    Quote Originally Posted by farmerrich View Post
    Jordnel ! I forgot about you! i LOVE YOUR work aswell, also if mwxplayer was aimbotting on TG clan zombies server with bunkers on iw5wm .... I mightve been pissed off and told tg to ban/kick himm... ehhe ehehe.... Anyways.... well... kenshin. Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag1)
    Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag2) Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag3)Could you PLEASE MAKE A BUNKER PLUGIN FOR IW5M, TEKNO OR SOMETHING (nag4)
    ._________________.

  16. #14
    farmerrich's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    Whaaaat? Cant you make it

  17. #15
    mwxplayer's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    hax
    Posts
    584
    Reputation
    10
    Thanks
    2,663
    My Mood
    Doh
    Quote Originally Posted by farmerrich View Post
    Whaaaat? Cant you make it
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System****;
    using InfinityScript;
    
    namespace MapEdit
    {
        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 =>
                {
                    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" };
                /* 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;
                }
                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));
                ent.Call("setmodel", "com_plasticcase_friendly");
                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();
            }
        }
    }
    Formats :
    Code:
    // ramp format
    // ramp: (startX, startY, startZ) ; (endX, endY, endZ)
    // elevator (portal) format ***THIS IS FOR TELEPORTING FLAGS***
    // elevator: (enterX, enterY, enterZ) ; (exitX, exitY, exitZ)
    // door format
    // door: (openX, openY, openZ) ; (closeX, closeY, closeZ) ; (angleX, angleY, angleZ) ; size ; height ; hp ; range
    // wall format
    // wall: (startX, startY, startZ) ; (endX, endY, endZ)
    // floor(/ceiling) format
    // floor: (corner1X, corner1Y, corner1Z) ; (corner2X, corner2Y, corner2Z)
    // HiddenTP(portal) format
    // HiddenTP: (enterX, enterY, enterZ) ; (exitX, exitY, exitZ)
    How to use!
    *Put the compiled .dll inside your IW5 Server folder/scripts/
    *Make a folder called maps inside the folder scripts.
    *Inside maps make a text file containing the map name.
    i.e. Hardhat = mp_hardhat.txt
    *Functions that you can use:


    I GAVE YOU EVERYTHING NOW LRN2 COMPLIE

    Credits : DUKIP,TheApadayo

Page 1 of 2 12 LastLast

Similar Threads

  1. [SOLVED]Care Package Bunker, Spawner
    By kleenkutschick in forum Call of Duty Modern Warfare 2 Help
    Replies: 2
    Last Post: 08-24-2010, 03:40 AM
  2. [Preview] Mw2 care package bunkers
    By craig1690 in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 2
    Last Post: 07-24-2010, 11:07 AM
  3. Do they have a hack for care packages
    By shaved93 in forum Call of Duty Modern Warfare 2 Help
    Replies: 10
    Last Post: 02-27-2010, 05:27 PM
  4. mw2 care package and emergancy unlimited glitch
    By smallladysman in forum Call of Duty Modern Warfare 2 Tutorials
    Replies: 8
    Last Post: 02-01-2010, 02:24 PM
  5. Care Package and Emergency Airdrop
    By tuve2 in forum Call of Duty Modern Warfare 2 Discussions
    Replies: 18
    Last Post: 01-26-2010, 10:42 AM

Tags for this Thread