Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.35 KB | None | 0 0
  1. using Oxide.Core.Libraries.Covalence;
  2. namespace Oxide.Plugins
  3.  
  4. {
  5.     [Info("Peachy's Utility Mod", "Peachy", "0.0.1", ResourceId = 2665)]
  6.     [Description("Has a lot of ulitities, such as teleporting to players.")]
  7.     class PeachysUtiltyMod : RustPlugin{
  8.         private void Init(){
  9.             Puts("Loaded Peachy's Utility Mod");
  10.         }
  11.         object OnRconConnection(IPEndPoint ip){
  12.             //Puts("RCON Connection from {0}", &ip);
  13.             return null;
  14.         }
  15.  
  16.         [Command("decay")]
  17.         private void decay(IPlayer player, string command, string[] args){
  18.             if (args[0] == "off"){
  19.                 ConsoleSystem.Run.Server.Normal("decay.upkeep false");
  20.                 ConsoleSystem.Run.Server.Normal("decay.scale 0");
  21.                 player.Reply("Decay has been turned off");
  22.             }
  23.             else if(args[1] == "on"){
  24.                 ConsoleSystem.Run.Server.Normal("decay.upkeep true");
  25.                 ConsoleSystem.Run.Server.Normal("decay.scale 1");
  26.                 player.Reply("Decay has been turned on");
  27.             }
  28.             else if(args[1] == "help"){
  29.                 player.Reply("These are the decay commands available to you:");
  30.                 player.Reply("/decay on turns building decay on");
  31.                 player.Reply("/decay off turns building decay off");
  32.             }
  33.         }
  34.  
  35.         [Command("teleport")]
  36.         private void teleport(IPlayer player, string command, string[] args){
  37.             if(args[1] == "player"){
  38.                 ConsoleSystem.Run.Server.Normal("teleport.toplayer {0} {1}", &player.displayName, &args[2]);
  39.                 player.Reply("Teleported to {0}", &args[2]);
  40.             }
  41.             else if(args[1] == "pos"){
  42.                 player.Reply("Teleport to coordinates not implemented yet");
  43.             }
  44.             else if(args[1] == "grid"){
  45.                 player.Reply("Teleport to grid not implemented yet");
  46.             }
  47.             else if(args[1] == "help"){
  48.                 player.Reply("These are the variants of /teleport:");
  49.                 player.Reply("/teleport player [playername] teleports you to the desired player");
  50.                 player.Reply("/teleport pos [x] [y] will teleport you to those specific coordinates");
  51.                 player.Reply("/teleport grid [grid index] will teleport you to the desired grid location");
  52.  
  53.             }
  54.  
  55.         }
  56.  
  57.         [Command("phelp")]
  58.         private void phelp(IPlayer player, string command, string[] args){
  59.             player.Reply("These are the commands you can perform:");
  60.             player.Reply("/teleport");
  61.             player.Reply("/decay");
  62.             player.Reply("/preload");
  63.             player.Reply("do /[command] help to find out more about individual commands");
  64.         }
  65.  
  66.         [Command("preload")]
  67.         private void reload(IPlayer player, string command, string[] args){
  68.             if(args[1] != null || args[1] != "help"){
  69.                  ConsoleSystem.Run.Server.Normal("oxide.reload {0}", &args[1]);
  70.             }
  71.             else if(args[1] == "help"){
  72.                 player.Reply("You can use this command to reload oxide mods");
  73.                 player.Reply("Do /preload [mod name] to do so");
  74.             }
  75.             else{
  76.                 player.Reply("Invalid command! Use /preload help for more info");
  77.             }
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement