Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using fCraft;
- namespace Hello
- {
- public class Init : Plugin
- {
- //everything that will happen upon startup
- public void Initialize()
- {
- Logger.Log(
- LogType.ConsoleOutput,
- Name + "(v " + Version + "): Registering Hello");
- //In this plugin, i am making a simple command
- //This code block right here "describes" the command
- CommandManager.RegisterCustomCommand(new CommandDescriptor
- {
- Name = "Hello",
- Aliases = new string[] { "Hi" },
- Category = CommandCategory.Chat | CommandCategory.Fun,
- Permissions = new Permission[] { Permission.Chat },
- IsConsoleSafe = true,
- Usage = "/Hello",
- Help = "Shouts out 'Hello' to the server!",
- Handler = HelloHandler,
- });
- }
- //plugin name
- public string Name
- {
- get
- {
- return "HelloPlugin";
- }
- set
- {
- Name = value;
- }
- }
- //plugin version
- public string Version
- {
- get
- {
- return "1.0";
- }
- set
- {
- Version = value;
- }
- }
- //handler name must be the same as in descriptor
- private static void HelloHandler(Player player, Command cmd)
- {
- //all the main code for your plugin will go here!
- Server.Message("Hello!");//will send a message to everyone on the server
- }
- //the end
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement