Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Oxide.Core.Libraries.Covalence;
- namespace Oxide.Plugins
- {
- [Info("Peachy's Utility Mod", "Peachy", "0.0.1", ResourceId = 2665)]
- [Description("Has a lot of ulitities, such as teleporting to players.")]
- class PeachysUtiltyMod : RustPlugin{
- private void Init(){
- Puts("Loaded Peachy's Utility Mod");
- }
- object OnRconConnection(IPEndPoint ip){
- //Puts("RCON Connection from {0}", &ip);
- return null;
- }
- [Command("decay")]
- private void decay(IPlayer player, string command, string[] args){
- if (args[0] == "off"){
- ConsoleSystem.Run.Server.Normal("decay.upkeep false");
- ConsoleSystem.Run.Server.Normal("decay.scale 0");
- player.Reply("Decay has been turned off");
- }
- else if(args[1] == "on"){
- ConsoleSystem.Run.Server.Normal("decay.upkeep true");
- ConsoleSystem.Run.Server.Normal("decay.scale 1");
- player.Reply("Decay has been turned on");
- }
- else if(args[1] == "help"){
- player.Reply("These are the decay commands available to you:");
- player.Reply("/decay on turns building decay on");
- player.Reply("/decay off turns building decay off");
- }
- }
- [Command("teleport")]
- private void teleport(IPlayer player, string command, string[] args){
- if(args[1] == "player"){
- ConsoleSystem.Run.Server.Normal("teleport.toplayer {0} {1}", &player.displayName, &args[2]);
- player.Reply("Teleported to {0}", &args[2]);
- }
- else if(args[1] == "pos"){
- player.Reply("Teleport to coordinates not implemented yet");
- }
- else if(args[1] == "grid"){
- player.Reply("Teleport to grid not implemented yet");
- }
- else if(args[1] == "help"){
- player.Reply("These are the variants of /teleport:");
- player.Reply("/teleport player [playername] teleports you to the desired player");
- player.Reply("/teleport pos [x] [y] will teleport you to those specific coordinates");
- player.Reply("/teleport grid [grid index] will teleport you to the desired grid location");
- }
- }
- [Command("phelp")]
- private void phelp(IPlayer player, string command, string[] args){
- player.Reply("These are the commands you can perform:");
- player.Reply("/teleport");
- player.Reply("/decay");
- player.Reply("/preload");
- player.Reply("do /[command] help to find out more about individual commands");
- }
- [Command("preload")]
- private void reload(IPlayer player, string command, string[] args){
- if(args[1] != null || args[1] != "help"){
- ConsoleSystem.Run.Server.Normal("oxide.reload {0}", &args[1]);
- }
- else if(args[1] == "help"){
- player.Reply("You can use this command to reload oxide mods");
- player.Reply("Do /preload [mod name] to do so");
- }
- else{
- player.Reply("Invalid command! Use /preload help for more info");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement