SHOW:
|
|
- or go back to the newest paste.
| 1 | - | using System; |
| 1 | + | using System; |
| 2 | - | using System.Collections.Generic; |
| 2 | + | using System.Collections.Generic; |
| 3 | - | using System.Linq; |
| 3 | + | using System.Linq; |
| 4 | - | using System.Text; |
| 4 | + | using System.Text; |
| 5 | - | using fCraft; |
| 5 | + | using fCraft; |
| 6 | - | |
| 6 | + | |
| 7 | - | |
| 7 | + | |
| 8 | - | namespace High5 |
| 8 | + | namespace High5 |
| 9 | - | { |
| 9 | + | {
|
| 10 | - | public class Init : Plugin |
| 10 | + | public class Init : Plugin |
| 11 | - | { |
| 11 | + | {
|
| 12 | - | public void Initialize() |
| 12 | + | public void Initialize() |
| 13 | - | { |
| 13 | + | {
|
| 14 | - | Logger.Log( |
| 14 | + | Logger.Log( |
| 15 | - | LogType.ConsoleOutput, |
| 15 | + | LogType.ConsoleOutput, |
| 16 | - | Name + "(v " + Version + "): LOL, registering /high5."); |
| 16 | + | Name + "(v " + Version + "): LOL, registering /high5."); |
| 17 | - | |
| 17 | + | |
| 18 | - | CommandManager.RegisterCustomCommand(new CommandDescriptor |
| 18 | + | CommandManager.RegisterCustomCommand(new CommandDescriptor |
| 19 | - | { |
| 19 | + | {
|
| 20 | - | Name = "High5", |
| 20 | + | Name = "High5", |
| 21 | - | Aliases = new string[] { "H5" }, |
| 21 | + | Aliases = new string[] { "H5" },
|
| 22 | - | Category = CommandCategory.Chat | CommandCategory.Fun, |
| 22 | + | Category = CommandCategory.Chat | CommandCategory.Fun, |
| 23 | - | Permissions = new Permission[] { Permission.HighFive }, |
| 23 | + | Permissions = new Permission[] { Permission.HighFive },
|
| 24 | - | IsConsoleSafe = true, |
| 24 | + | IsConsoleSafe = true, |
| 25 | - | Usage = "/High5 playername", |
| 25 | + | Usage = "/High5 playername", |
| 26 | - | Help = "High fives a given player.", |
| 26 | + | Help = "High fives a given player.", |
| 27 | - | NotRepeatable = true, |
| 27 | + | NotRepeatable = true, |
| 28 | - | Handler = High5Handler, |
| 28 | + | Handler = High5Handler, |
| 29 | - | }); |
| 29 | + | }); |
| 30 | - | } |
| 30 | + | } |
| 31 | - | |
| 31 | + | |
| 32 | - | public string Name |
| 32 | + | public string Name |
| 33 | - | { |
| 33 | + | {
|
| 34 | - | get |
| 34 | + | get |
| 35 | - | { |
| 35 | + | {
|
| 36 | - | return "High5Plugin"; |
| 36 | + | return "High5Plugin"; |
| 37 | - | } |
| 37 | + | } |
| 38 | - | set |
| 38 | + | set |
| 39 | - | { |
| 39 | + | {
|
| 40 | - | Name = value; |
| 40 | + | Name = value; |
| 41 | - | } |
| 41 | + | } |
| 42 | - | } |
| 42 | + | } |
| 43 | - | |
| 43 | + | |
| 44 | - | public string Version |
| 44 | + | public string Version |
| 45 | - | { |
| 45 | + | {
|
| 46 | - | get |
| 46 | + | get |
| 47 | - | { |
| 47 | + | {
|
| 48 | - | return "1.0"; |
| 48 | + | return "1.0"; |
| 49 | - | } |
| 49 | + | } |
| 50 | - | set |
| 50 | + | set |
| 51 | - | { |
| 51 | + | {
|
| 52 | - | Version = value; |
| 52 | + | Version = value; |
| 53 | - | } |
| 53 | + | } |
| 54 | - | } |
| 54 | + | } |
| 55 | - | |
| 55 | + | |
| 56 | - | private static void High5Handler(Player player, Command cmd) |
| 56 | + | private static void High5Handler(Player player, Command cmd) |
| 57 | - | { |
| 57 | + | {
|
| 58 | - | string targetName = cmd.Next(); |
| 58 | + | string targetName = cmd.Next(); |
| 59 | - | if (targetName == null){ |
| 59 | + | if (targetName == null){
|
| 60 | - | player.Message("Please enter a player's name."); |
| 60 | + | player.Message("Please enter a player's name.");
|
| 61 | - | return; |
| 61 | + | return; |
| 62 | - | } |
| 62 | + | } |
| 63 | - | Player target = Server.FindPlayerOrPrintMatches(player, targetName, false, true); |
| 63 | + | Player target = Server.FindPlayerOrPrintMatches(player, targetName, false, true); |
| 64 | - | if (target == null){ |
| 64 | + | if (target == null){
|
| 65 | - | player.MessageNoPlayer(targetName); |
| 65 | + | player.MessageNoPlayer(targetName); |
| 66 | - | return; |
| 66 | + | return; |
| 67 | - | } |
| 67 | + | } |
| 68 | - | if (target == player) { |
| 68 | + | if (target == player) {
|
| 69 | - | player.Message("&WFeeling lonely are we?"); |
| 69 | + | player.Message("&WFeeling lonely are we?");
|
| 70 | - | return; |
| 70 | + | return; |
| 71 | - | } |
| 71 | + | } |
| 72 | - | Server.Players.CanSee(target).Except(target).Message("{0}&S recieved a &ckiss &Sfrom {1}&S.", target.ClassyName, player.ClassyName); |
| 72 | + | Server.Players.CanSee(target).Except(target).Message("{0}&S recieved a &chighfive &Sfrom {1}&S.", target.ClassyName, player.ClassyName);
|
| 73 | - | IRC.PlayerSomethingMessage(player, "highfived", target, null); |
| 73 | + | IRC.PlayerSomethingMessage(player, "highfived", target, null); |
| 74 | - | target.Message("{0}&S highfived you.", player.ClassyName); |
| 74 | + | target.Message("{0}&S highfived you.", player.ClassyName);
|
| 75 | - | |
| 75 | + | |
| 76 | - | } |
| 76 | + | } |
| 77 | - | |
| 77 | + | |
| 78 | - | } |
| 78 | + | } |
| 79 | } |