Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
@ 8q4s8 thanks anyway
But I did post it in steps 7,8,9 or something like that
But thanks
Posts: 144
Threads: 5
Joined: Dec 2012
Reputation:
3
is it possible if u can make an video?
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
(01-08-2013, 19:37)EnVi Sweden Rocks Wrote: is it possible if u can make an video?
What should I do in it? Make the code live?
If you want that I can maybe do it, but not today I got an test in 20 minutes so I need to learn for that , and I will be late back.
Maybe tomorrow
Posts: 273
Threads: 14
Joined: Aug 2012
Reputation:
17
(01-08-2013, 19:33)99IRock Wrote: Noo , look In my topic at the lower bottom I expained it (where to place it)
place it after
CSHARP Code
public class Boxes : CPlugin // Always use : CPlugin behind your class name {
@8q4s8 I would like to have that
Writing it to a textfile:
CSHARP Code
string map = GetDvar("mapname"); StreamWriter writer = new StreamWriter ("C:\\Mw3\\Entity\\" + 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();
Posts: 144
Threads: 5
Joined: Dec 2012
Reputation:
3
np man, i can wait
Posts: 144
Threads: 5
Joined: Dec 2012
Reputation:
3
(01-08-2013, 18:44)99IRock Wrote: I made this tutorial for @SaviouR9966 and offcourse any other people who needs it
Well most of the people know this info already, but for the new people:
I made some basic commands to help you making carepackage boxes.
First of all the basics on making a plugin:
1 Make a new project in visual studio.
2 Make 2 classes, Extensions.cs and Boxes.cs
3 Copy and paste the code from this to extensions.cs topic made by@master131
4 Put those parts of code in Boxes.cs
Extensions.cs
is it only that code i need to copy, not the other ones? (step 3)
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
You need to click on "this" and than copy the code of extensions.cs there, and paste it in your extensions.cs
The link was wrong, I fixed it
http://www.itsmods.com/forum/Thread-Rele...3#pid94703
Sorry :p
Posts: 43
Threads: 1
Joined: Dec 2012
Reputation:
0
I made everything according to the instruction but at compilation of this code:
Code: using System;
using Addon;
namespace Addon
{
public class Boxes : CPlugin // : CPlugin
{
public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat)
{
if (Message == "!noclip") //
{
Client.Other.NoClip = !Client.Other.NoClip; // koro35
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;
}
} // }
public override void OnMapChange() // The event OnMapChange
{
string map = GetDvar("mapname");
if (map == "mp_dome") // -
{
Entity domeleft = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(462f, 108f, -220f)); // domeleft 462f, 108f, -220f
Entity domeright = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-373f, -103f, -220f)); // domeright -373f, -103f, -220f
Extensions.CloneBrushModelToScriptModel(domeleft, Extensions.FindAirdropCrateCollisionId()); //
Extensions.CloneBrushModelToScriptModel(domeright, Extensions.FindAirdropCrateCollisionId()); //
}
} //
}
}
There are these mistakes:
Mistake 1 Inadmissible element "."
The mistake 2 Is required ";"
The mistake 3 Is required ";"
In this line:
Code: Return ChatType.ChatNone;
How to correct it?
Posts: 5,320
Threads: 300
Joined: Feb 2011
Reputation:
149
01-09-2013, 08:33
(This post was last modified: 01-09-2013, 08:35 by JariZ.)
Good tutorial, wrong section. Moved.
return is a keyword and shouldn't be capitalized.
Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
01-09-2013, 08:42
(This post was last modified: 01-09-2013, 08:43 by master131.)
(01-09-2013, 08:12)ltybcs Wrote: How to correct it?
Code: using System;
using Addon;
namespace Addon
{
public class Boxes : CPlugin // : CPlugin
{
public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat)
{
if (Message == "!noclip") //
{
Client.Other.NoClip = !Client.Other.NoClip; // koro35
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;
}
return ChatType.ChatContinue;
} // }
public override void OnMapChange() // The event OnMapChange
{
string map = GetDvar("mapname");
if (map == "mp_dome") // -
{
Entity domeleft = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(462f, 108f, -220f)); // domeleft 462f, 108f, -220f
Entity domeright = SpawnModel("script_model", "com_plasticcase_trap_friendly", new Vector(-373f, -103f, -220f)); // domeright -373f, -103f, -220f
Extensions.CloneBrushModelToScriptModel(domeleft, Extensions.FindAirdropCrateCollisionId()); //
Extensions.CloneBrushModelToScriptModel(domeright, Extensions.FindAirdropCrateCollisionId()); //
}
} //
}
}
A casual conversation between barata and I about Nukem.
|