• 3 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] [CODE][TUT]Boxes
#11
@8q4s8 thanks anyway Tongue
But I did post it in steps 7,8,9 or something like that Tongue
But thanksSmile
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
  Reply
#12
is it possible if u can make an video?
  Reply
#13
(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? Tongue
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
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
  Reply
#14
(01-08-2013, 19:33)99IRock Wrote: Noo Tongue, look In my topic at the lower bottom I expained it (where to place it)
place it after
CSHARP Code
  1. public class Boxes : CPlugin // Always use : CPlugin behind your class name
  2. {


@8q4s8 I would like to have that Smile

Writing it to a textfile:

CSHARP Code
  1. string map = GetDvar("mapname");
  2. StreamWriter writer = new StreamWriter("C:\\Mw3\\Entity\\" + map + ".txt", true);
  3.  
  4. writer.WriteLine("Entity ent" + ent + " = SpawnModel(" + "script_model" + "," + "com_plasticcase_trap_friendly" + "," + "new Vector(" + locationX + "f" + "," + locationY + "f" + "," + locationZ + "f" + "))" + ";");
  5. writer.Dispose();
  6. writer.Close();
  Reply
#15
np man, i can wait Smile
  Reply
#16
(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)
  Reply
#17
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
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
  Reply
#18
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?
  Reply
#19
Good tutorial, wrong section. Moved.

return is a keyword and shouldn't be capitalized.
  Reply
#20
(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()); //  
            }
        } //    
    }
}
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
  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 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,791 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
  [Release] Interactive Boxes Yamato 1 2,242 06-29-2013, 18:20
Last Post: DidUknowiPwn
  Code of vector Bloodfocus 1 2,187 06-23-2013, 11:54
Last Post: Yamato
  Help boxes [HARD] Tony. 3 2,607 05-16-2013, 18:29
Last Post: DidUknowiPwn
  problem with gsc code CheGuevara 5 5,055 04-20-2013, 15:06
Last Post: Nekochan

Forum Jump:


Users browsing this thread: 1 Guest(s)