I have a code that I'm meant to compile into a .DLL file (it's for the game Call of Duty: Modern Warfare 3). However, it wont compile. Any ideas? Thanks!
using MapEdit;
using Addon;
using System;
namespace mp_terminal_cls
{
public class mp_terminal_cls : MapEdit
{
public mp_terminal_cls()
{
}
createfloor(new Vector(2263f,4406f,286f),new Vector(2958f,4147f,286f));
public override void OnMapChange()
{
base.OnMapChange();
}
}
}
I get 7 errors, the problem is the original code was exactly the same. I only added 2 new lines of code. Here is the errors:
Sorry I'm quite new to C# I only have about 2 months experience with VB.
1) Move the call to createfloor
either into the constructor's body or OnMapChange
's body (from your code, we can't tell which one you need):
public mp_terminal_cls()
{
createfloor(new Vector(2263f,4406f,286f),new Vector(2958f,4147f,286f));
}
or
public override void OnMapChange()
{
createfloor(new Vector(2263f,4406f,286f),new Vector(2958f,4147f,286f));
base.OnMapChange();
}
2) The base class MapEdit
doesn't seem to have a OnMapChanged
method.
As a side-note, your classes and namespaces should have distinct names, to avoid ambiguity issues.
There are essentially two errors
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.