03-22-2013, 17:47
using System;
using Addon;
namespace Addon
{
public class Boxeh : CPlugin
{
string map = GetDvar("mapname");
StreamWriter writer = new StreamWriter("E:\\call of duty modern warfare 3\\plugins\\" + map + ".txt", true);
writer.WriteLine("Entity ent" + ent + " = SpawnModel(" + "script_model" + "," + "com_plasticcase_trap_friendly" + "," + "new Vector(" + locationX + "f" + "," + locationY + "f" + "," + locationZ + "f" + "))" + ";");
writer.Dispose();
writer.Close();
}
public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat)
{
if (Message == "!n") //
{
Client.Other.NoClip = !Client.Other.NoClip;
return ChatType.ChatNone;
}
if (Message == "!pos") //
{
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;
}
if (Message == "!tut")
{
Entity a300 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(Client.OriginX, Client.OriginY, Client.OriginZ));
Extensions.CloneBrushModelToScriptModel(a300, Extensions.FindAirdropCrateCollisionId());
}
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; //one more !ent
//int ent = 0;
}
return ChatType.ChatContinue;
}
public override void OnMapChange()
{
string map = GetDvar("mapname");
if (map == "mp_dome")
{
Entity ent1 = SpawnModel("script_model", "com_plasticcase_trap_friendly",new Vector(-580f, 4130f, 744f));
Extensions.CloneBrushModelToScriptModel(ent1, Extensions.FindAirdropCrateCollisionId()); //
}
}
}
}
using Addon;
namespace Addon
{
public class Boxeh : CPlugin
{
string map = GetDvar("mapname");
StreamWriter writer = new StreamWriter("E:\\call of duty modern warfare 3\\plugins\\" + map + ".txt", true);
writer.WriteLine("Entity ent" + ent + " = SpawnModel(" + "script_model" + "," + "com_plasticcase_trap_friendly" + "," + "new Vector(" + locationX + "f" + "," + locationY + "f" + "," + locationZ + "f" + "))" + ";");
writer.Dispose();
writer.Close();
}
public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat)
{
if (Message == "!n") //
{
Client.Other.NoClip = !Client.Other.NoClip;
return ChatType.ChatNone;
}
if (Message == "!pos") //
{
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;
}
if (Message == "!tut")
{
Entity a300 = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(Client.OriginX, Client.OriginY, Client.OriginZ));
Extensions.CloneBrushModelToScriptModel(a300, Extensions.FindAirdropCrateCollisionId());
}
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; //one more !ent
//int ent = 0;
}
return ChatType.ChatContinue;
}
public override void OnMapChange()
{
string map = GetDvar("mapname");
if (map == "mp_dome")
{
Entity ent1 = SpawnModel("script_model", "com_plasticcase_trap_friendly",new Vector(-580f, 4130f, 744f));
Extensions.CloneBrushModelToScriptModel(ent1, Extensions.FindAirdropCrateCollisionId()); //
}
}
}
}