Posts: 144
Threads: 5
Joined: Dec 2012
Reputation:
3
(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
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.
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
(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
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
He updated it and now it's fixed download new version
Posts: 144
Threads: 5
Joined: Dec 2012
Reputation:
3
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
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
(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 ?
Posts: 285
Threads: 15
Joined: Nov 2011
Reputation:
12
Add reference to mapedit1.dll
Posts: 144
Threads: 5
Joined: Dec 2012
Reputation:
3
02-01-2013, 22:46
(This post was last modified: 02-01-2013, 22:46 by EnVi Sweden Rocks.)
(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));
}
}
}
}
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
02-01-2013, 23:02
(This post was last modified: 02-01-2013, 23:51 by 99IRock.)
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
Posts: 285
Threads: 15
Joined: Nov 2011
Reputation:
12
Posts: 69
Threads: 8
Joined: Feb 2012
Reputation:
1
source please?, a friend want to have a look.
Posts: 285
Threads: 15
Joined: Nov 2011
Reputation:
12
|