• 4 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] Bunker Plugin 1.3
#21
(02-01-2013, 19:53)99IRock Wrote:
(02-01-2013, 16:23)EnVi Sweden Rocks Wrote: where can i save the code so it will be permanent?


Use what I used in my boxes plugin
(Use event onmapchange)

It will look like this Wink

Code:
public override void OnMapChange()
        {
            string map = GetDvar("mapname");
            if (map == "mp_plaza2")
            {
                //closing windows
                CreateWall(new Vector(767f, 1428f, 690f), new Vector(1347f, 1428f, 705));
            }
        }

Place it there where the CreateWAll is.
If you change the map in console, everything you made will be printed.
Copy and past eit in your plugin voila

i cant get it to work. i get errors.
  Reply
#22
(02-01-2013, 21:03)EnVi Sweden Rocks Wrote:
(02-01-2013, 19:53)99IRock Wrote:
(02-01-2013, 16:23)EnVi Sweden Rocks Wrote: where can i save the code so it will be permanent?


Use what I used in my boxes plugin
(Use event onmapchange)

It will look like this Wink

Code:
public override void OnMapChange()
        {
            string map = GetDvar("mapname");
            if (map == "mp_plaza2")
            {
                //closing windows
                CreateWall(new Vector(767f, 1428f, 690f), new Vector(1347f, 1428f, 705));
            }
        }

Place it there where the CreateWAll is.
If you change the map in console, everything you made will be printed.
Copy and past eit in your plugin voila

i cant get it to work. i get errors.

You got like this
716,123f
Remove ,123 and it will be 716f
Than it will work Wink
He updated it and now it's fixed download new version
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
  Reply
#23
then i copy the text i had changed to no decimals, do i get errors of creatWall and floor.
nothing other only wall and floor is error on everything
  Reply
#24
(02-01-2013, 21:39)EnVi Sweden Rocks Wrote: then i copy the text i had changed to no decimals, do i get errors of creatWall and floor.
nothing other only wall and floor is error on everything

Code ?
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
  Reply
#25
Add reference to mapedit1.dll
  Reply
#26
(02-01-2013, 22:29)99IRock Wrote:
(02-01-2013, 21:39)EnVi Sweden Rocks Wrote: then i copy the text i had changed to no decimals, do i get errors of creatWall and floor.
nothing other only wall and floor is error on everything

Code ?

Code:
using System;
using Addon;

namespace Addon
{
    public class Boxes : CPlugin //  : CPlugin  
    {
        int ent = 0;

        public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat)
        {
            if (Message == "!noclip") // Lets you fly
            {
                Client.Other.NoClip = !Client.Other.NoClip;
                return ChatType.ChatNone;
            }
            if (Message.ToLower().StartsWith("!box"))// This will spawn a new box
            {
                int ent = 0;
                float locationX = Client.OriginX;
                float locationY = Client.OriginY;
                float locationZ = Client.OriginZ;
                Entity entdefault = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(locationX, locationY, locationZ));
                Extensions.CloneBrushModelToScriptModel(entdefault, Extensions.FindAirdropCrateCollisionId());
                ent++;
                ServerPrint("Entity ent" + ent + " = SpawnModel(" + "script_model" + "," + "com_plasticcase_trap_friendly" + "," + "new Vector(" + locationX + "f" + "," + locationY + "f" + "," + locationZ + "f" + "))" + ";");
                Client.OriginZ += 45f;//height at which you will appear above new box
                return ChatType.ChatNone;
                //int ent = 0;

            }
            else if (Message.ToLower().StartsWith("!ent")) // this is for changing the entity number if you restarted the server or placed a box in the wrong location
            {
                string[] split = Message.Split(' ');
                try
                {
                    ent = int.Parse(split[1]);
                }
                catch
                {
                    return ChatType.ChatContinue;
                }
            }
            if (Message == "!pos") // shows position
            {
                ServerPrint(Client.Name + "is on the position X: " + Client.OriginX + " Y: " + Client.OriginY + " Z: " + Client.OriginZ); // Serverprints the coords
                TellClient(Client.ClientNum, "You are on the position X: " + Client.OriginX + " Y: " + Client.OriginY + " Z: " + Client.OriginZ, true); // Send a message to client
                return ChatType.ChatNone;
            }

            return ChatType.ChatContinue;
        }

        public override void OnMapChange() // The event OnMapChange
        {

            string map = GetDvar("mapname");
            if (map == "mp_dome") // In this case I use dome to close off the stairs
            {

                Entity ent = SpawnModel("script_model","com_plasticcase_trap_friendly",new Vector(-2938f, -6255f, -310f));
                Entity ent1 = SpawnModel("script_model","com_plasticcase_trap_friendly",new Vector(-2263f, 949f, -356f));
                Entity ent2 = SpawnModel("script_model","com_plasticcase_trap_friendly",new Vector(-271f, 266f, -565f));
                Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId()); // Makes the entity domeleft solid
                Extensions.CloneBrushModelToScriptModel(ent1, Extensions.FindAirdropCrateCollisionId()); //
                Extensions.CloneBrushModelToScriptModel(ent2, Extensions.FindAirdropCrateCollisionId());
                createfloor(new Vector(-414f,5960f,230f),new Vector(-3704f,5956f,254f));
CreateWall(new Vector(-4222f,5949f,234f),new Vector(-3540f,5962f,268f));
CreateWall(new Vector(-3540f,5962f,268f),new Vector(-3579f,6523f,282f));
CreateWall(new Vector(-3605f,6519f,279f),new Vector(-4217,586f,6528f));
CreateWall(new Vector(-4214f,6528f,300f),new Vector(-3567f,6528f,268f));
CreateWall(new Vector(-4241f,5959f,248f),new Vector(-4241f,6509f,296f));
CreateWall(new Vector(-4232f,6534f,289f),new Vector(-3584f,6551f,285f));
CreateWall(new Vector(-3584f,6551f,285f),new Vector(-4225f,6564f,281f));
CreateWall(new Vector(-4225f,6564f,281f),new Vector(-3583f,6570f,272f));
createfloor(new Vector(-3575f,6535f,280f),new Vector(-4156f,6507f,279f));
createfloor(new Vector(-3603f,6497f,283f),new Vector(-4207f,6471f,285f));
createfloor(new Vector(-4200f,6501f,296f),new Vector(-4200f,6501f,296f));
CreateWall(new Vector(-3547f,6530f,91f),new Vector(-3569f,6530f,254f));
CreateWall(new Vector(-3534f,5957f,196f),new Vector(-3523f,5957f,60f));
createfloor(new Vector(-3565f,6502f,81f),new Vector(-3534f,5953f,63f));
CreateWall(new Vector(-3505f,5958f,175f),new Vector(-3574f,5959f,75f));
CreateWall(new Vector(-4217f,6527f,277f),new Vector(-4183f,6526f,51f));
createfloor(new Vector(-3609f,6526f,77f),new Vector(-4295f,6545f,86f));
CreateWall(new Vector(-4215f,6513f,193f),new Vector(-4213f,6513f,68f));
CreateWall(new Vector(-4266f,6524f,92f),new Vector(-4266f,6524f,170f));
CreateWall(new Vector(-4253f,6522f,187f),new Vector(-4258f,6522f,262f));
createfloor(new Vector(-4114f,6530f,280f),new Vector(-4229f,6533f,280f));
CreateWall(new Vector(-3552f,5971f,96f),new Vector(-3561f,5970f,223f));
createfloor(new Vector(-3598f,5971f,52f),new Vector(-4258f,5938f,79f));
CreateWall(new Vector(-4241f,5981f,67f),new Vector(-4242f,5992f,231f));
createfloor(new Vector(-4251f,6015f,72f),new Vector(-4262f,6503f,82f));
createfloor(new Vector(-4262f,6503f,82f),new Vector(-424f,6013f,61f));
createfloor(new Vector(-4241f,6013f,61f),new Vector(-4264f,6521f,56f));
createfloor(new Vector(-4264f,6521f,56f),new Vector(-4256f,598f,32f));
createfloor(new Vector(-4256f,5981f,55f),new Vector(-4259f,6539f,56f));
createfloor(new Vector(-4259f,6542f,65f),new Vector(-4248f,5966f,50f));
createfloor(new Vector(-4244f,6025f,100f),new Vector(-4267f,6521f,83f));
createfloor(new Vector(-4267f,6522f,106f),new Vector(-4247f,6007f,107f));
createfloor(new Vector(-4247f,6007f,107f),new Vector(-4265f,6532f,101f));
createfloor(new Vector(-4265f,6532f,101f),new Vector(-4253f,6031f,92f));


                //Now to rotate
                Extensions.SetAngles(ent, new Vector(0, 0, 0));// left at default
                Extensions.SetAngles(ent1, new Vector(0, 45, 0));// this will rotate 45 degrees
                Extensions.SetAngles(ent2, new Vector(0, 0, 0));
            }
            if (map == "mp_paris")
            {        
                Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-752f, -3125f, 825f)); // spawns new boxes
                Entity ent1 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-324f, -3125f, 825f));
                Entity ent2 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-420f, -3125f, 825f));
                Entity ent3 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-584f, 1014f, 580f));
                Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent1, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent2, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent3, Extensions.FindAirdropCrateCollisionId());

                                
                Extensions.SetAngles(ent, new Vector(0, 0, 0));
                Extensions.SetAngles(ent1, new Vector(0, 0, 0));
                Extensions.SetAngles(ent2, new Vector(0, 0, 0));
                Extensions.SetAngles(ent3, new Vector(0, 0, 0));
            }    
            if (map == "mp_aground_ss")
            {
                Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-1362f, -49f, 590f));
                Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId());

                Extensions.SetAngles(ent, new Vector(0, 0, 0));
            }
            if (map == "mp_terminal_cls")
            {
                Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(1145f, 3427f, -93f));
                Entity ent1 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(1311f, 3757f, -237f));
                Entity ent2 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(3968f, 2962f, 42f));
                Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent1, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent2, Extensions.FindAirdropCrateCollisionId());

                Extensions.SetAngles(ent, new Vector(0, 0, 0));
                Extensions.SetAngles(ent1, new Vector(0, 0, 0));
                Extensions.SetAngles(ent2, new Vector(0, 0, 0));
            }
            if (map == "mp_lambeth")
            {
                Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-925f, -812f, -188f));
                Entity ent1 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(554f, 1609f, -50f));
                Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent1, Extensions.FindAirdropCrateCollisionId());

                Extensions.SetAngles(ent, new Vector(0, 0, 0));
                Extensions.SetAngles(ent1, new Vector(0, 0, 0));
            }
            if (map == "mp_underground")
            {
                Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(0f, 0f, -500f));
                Entity ent1 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(45f, 6f, -530f));
                Entity ent2 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(6f, 34f, -564f));
                Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent1, Extensions.FindAirdropCrateCollisionId());
                Extensions.CloneBrushModelToScriptModel(ent2, Extensions.FindAirdropCrateCollisionId());

                Extensions.SetAngles(ent, new Vector(0, 0, 0));
                Extensions.SetAngles(ent1, new Vector(0, 0, 0));
                Extensions.SetAngles(ent2, new Vector(0, 0, 0));
            }
        }
    }
}
  Reply
#27
This :
Code:
using System;
using Addon;

namespace Addon
{
    public class Boxes : CPlugin //  : CPlugin  
    {

FIRST REFERENCE MAPEDIT1.DLL !!!!

Should be this
Code:
using System;
using Addon;
using MapEdit;

namespace Addon
{
    public class Boxes : MapEdit.MapEdit // If I'm right this is spelled correctly
    {

Fixed @EnVi Sweden Rocks problem on teamviewer, guys, don't forget to reference MapEdit1.dll !
If you can't get it to work, pm me!, if there are bugs I guess pm @archit or this topic
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
  Reply
#28
New Update!
  Reply
#29
source please?, a friend want to have a look.
  Reply
#30
http://pastebin.com/kf0Sgh9E
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bunker Z00mby aground [HARD] Tony. 5 4,077 12-09-2013, 23:24
Last Post: surtek
Wink Plugin with !ban !kick and !tampban clemi555 3 3,885 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,342 11-08-2013, 19:13
Last Post: clemi555
  Help Modifying plugin maverigh 5 5,245 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 4,604 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 57,441 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 17,343 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,524 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 30,301 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 2,840 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread: 4 Guest(s)