Hey i am new to making plugins and i have run into an inssue (yes i may have got the base of the code from another plugin)
this code works:
but this code doesnt:Code:using System.Collections.Generic; using System.Reflection; using System; using System.Data; using UnityEngine; using Oxide.Core;namespace Oxide.Plugins { [Info("MyDayEditor", "masterlewis02", "1.0.0", ResourceId = 984)] [Description("Set time of day")] class MyDayEditor : RustPlugin { [ChatCommand("time")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 8AM!"); TOD_Sky.Instance.Cycle.Hour = 8; SaveRestore.Save(); return; } }/* [ChatCommand("night")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 16PM!"); TOD_Sky.Instance.Cycle.Hour = 16; SaveRestore.Save(); return; } } [ChatCommand("afternoon")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 12AM!"); TOD_Sky.Instance.Cycle.Hour = 12; SaveRestore.Save(); return; } } [ChatCommand("midnight")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 24PM!"); TOD_Sky.Instance.Cycle.Hour = 24; SaveRestore.Save(); return; } }*/ //---------------------------> Player finding <---------------------------// //----------------------------> Chat Sending <----------------------------// void BroadcastChat(string prefix, string msg) { PrintToChat("<color=orange>" + prefix + "</color>: " + msg); } void SendChatMessage(BasePlayer player, string prefix, string msg) { SendReply(player, "<color=orange>" + prefix + "</color>: " + msg); } //---------------------------------------------------------------------------// } }
please help thank youCode:using System.Collections.Generic; using System.Reflection; using System; using System.Data; using UnityEngine; using Oxide.Core;namespace Oxide.Plugins { [Info("MyDayEditor", "masterlewis02", "1.0.0", ResourceId = 984)] [Description("Set time of day")] class MyDayEditor : RustPlugin { [ChatCommand("time")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 8AM!"); TOD_Sky.Instance.Cycle.Hour = 8; SaveRestore.Save(); return; } } [ChatCommand("night")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 16PM!"); TOD_Sky.Instance.Cycle.Hour = 16; SaveRestore.Save(); return; } }/* [ChatCommand("afternoon")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 12AM!"); TOD_Sky.Instance.Cycle.Hour = 12; SaveRestore.Save(); return; } } [ChatCommand("midnight")] void save(BasePlayer player, string cmd, string[] args) { if (!player.IsAdmin()) { SendChatMessage(player, "TIME", "You have no permission to use this command!"); if (args.Length != 1) { Puts(player.displayName + " got rejected from using /day"); return; } if (args.Length == 1) { Puts(player.displayName + " got rejected from using /day " + args[0]); } return; } if (args.Length != 1) { PrintToChat(player, "CHANGING TIME TO 24PM!"); TOD_Sky.Instance.Cycle.Hour = 24; SaveRestore.Save(); return; } }*/ //---------------------------> Player finding <---------------------------// //----------------------------> Chat Sending <----------------------------// void BroadcastChat(string prefix, string msg) { PrintToChat("<color=orange>" + prefix + "</color>: " + msg); } void SendChatMessage(BasePlayer player, string prefix, string msg) { SendReply(player, "<color=orange>" + prefix + "</color>: " + msg); } //---------------------------------------------------------------------------// } }oh if u cant tell i /* */ out parts because i added more in
Help with day plugin
Discussion in 'Rust Development' started by masterlewis02, Sep 8, 2015.

oh if u cant tell i /* */ out parts
because i added more in