12-10-2012, 16:50
(12-10-2012, 16:48)99IRock Wrote: By me it works fine, I also gave my project files, and still not working.
If u need someinformation : I have Microsoft visual C# 2010 express, and I compiled with 3.0
My references are :
- Addon
- Microsoft.CSharp
- System
- System.core
- System.data
- System.data.datasetextensions
- System.Xml
- System.Xml.Linq
2 classes :
Extensions.cs (with the code from master131)
Class1.cs (My own code for carepackages )
Code class1.cs
Code:using System.Collections.Generic;
using System.Linq;
using System.Text;
using Addon;
namespace Boxes
{
public class Class1 : CPlugin
{
public override void OnMapChange()
{
string map = GetDvar("mapname");
if (map == "mp_carbon")
{
Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-926f, -4535f, 4576f));
ent.CloneBrushModelToScriptModel(Extensions.FindAirdropCrateCollisionId());
}
}
public override void OnFastRestart()
{
string map = GetDvar("mapname");
if (map == "mp_carbon")
{
Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-926f, -4535f, 4576f));
ent.CloneBrushModelToScriptModel(Extensions.FindAirdropCrateCollisionId());
}
}
}
}
I hope u can use this info for something
EDIT : I have also 2 warnings
Code:Warning 2 The referenced component 'Microsoft.CSharp' could not be found.
Code:Warning 1 Could not resolve this reference. Could not locate the assembly "Microsoft.CSharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. Boxes
You have thoose two warnings because you switched .net to 3.0
You can just remove Microsoft.Csharp and they will gone.