• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help error code
#1
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()); //


}
}
}
}
  Reply
#2
What's the error ? Huh.

Code:
l2code
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
  Reply
#3
Use the streamwriter code in the !box command.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Code color crosshairs koren30 3 3,628 10-02-2013, 19:26
Last Post: koren30
  Help error when run mod mr.apple 9 6,065 09-24-2013, 21:49
Last Post: Nekochan
  Help need help?how to make plugins code hXnarutoXone 12 7,679 09-01-2013, 18:30
Last Post: Bandarigoda123
  Help Need Help with C# code tubwux 2 3,090 08-27-2013, 18:18
Last Post: tubwux
  [Request] Compile this code please dozsa0 4 3,779 08-10-2013, 21:02
Last Post: Nukem
  Compile this code please First_Semyon 12 8,790 08-08-2013, 14:53
Last Post: Bandarigoda123
  Compile please this code First_Semyon 8 5,150 07-28-2013, 01:52
Last Post: First_Semyon
  Help COD mw3 Error Couln't load image 3_cursor3:s Paylgs 2 13,481 07-18-2013, 18:46
Last Post: Nekochan
  Mod Error! help please Brandeeno 2 3,751 07-11-2013, 21:06
Last Post: Brandeeno
  Help xkmod error Domino29 2 4,150 07-11-2013, 20:07
Last Post: Brandeeno

Forum Jump:


Users browsing this thread: 1 Guest(s)