Everything posted by RainZhang
-
I am accepting plugin requests
My XP isn't saved on server restart and the xp prefix still doesn't work for some reason.
-
I am accepting plugin requests
Thanks, it works now, only problem is that you need to restart the server for it to work. Oh, and /xp shows 'Your Information', and nothing else.
-
I am accepting plugin requests
The level up still doesn't change. I'll send you the PasteBin link: https://pastebin.com/raw/53svX7Bp
-
I am accepting plugin requests
It still doesn't update upon leveling up/joining. Oh, and MCGalaxy logs yields this: Type: SQLiteException Source: MCGalaxy_ Message: SQL logic error no such table: XP Trace: at MCGalaxy.SQL.SQLiteConnection.Prepare (System.String strSql, System.String& strRemain) [0x0008a] in <aac90df087464427b1873dde33a35dd1>:0 at MCGalaxy.SQL.SQLiteCommand.NextStatement () [0x0004b] in <aac90df087464427b1873dde33a35dd1>:0 at MCGalaxy.SQL.SQLiteDataReader.NextResult () [0x00006] in <aac90df087464427b1873dde33a35dd1>:0 at MCGalaxy.SQL.SQLiteCommand.ExecuteReader () [0x00012] in <aac90df087464427b1873dde33a35dd1>:0 at MCGalaxy.SQL.IDatabaseBackend.Iterate (System.String sql, System.Object[] parameters, MCGalaxy.SQL.ReaderCallback callback) [0x00036] in <aac90df087464427b1873dde33a35dd1>:0 at MCGalaxy.SQL.Database.Do (System.String sql, System.Boolean createDB, MCGalaxy.SQL.ReaderCallback callback, System.Object[] args) [0x00010] in <aac90df087464427b1873dde33a35dd1>:0
-
I am accepting plugin requests
Link: https://pastebin.com/raw/CCL5swpW
-
I am accepting plugin requests
//reference System.Core.dll /* You will need to replace all "secretcode" values with a random code. - To reward XP from an external plugin/command, use 'Command.Find("XP").Use(p, "secretcode " + [player] + " [xp amount]");' - To make it easier/harder to level up, modify the "0.02" value accordingly. */ using System; using System.Collections.Generic; using MCGalaxy; using MCGalaxy.Commands; using MCGalaxy.SQL; namespace MCGalaxy { public class XP : Plugin { public override string creator { get { return "Venk"; } } public override string MCGalaxy_Version { get { return "1.9.3.0"; } } public override string name { get { return "XP"; } } public override void Load(bool startup) { Command.Register(new CmdXP()); InitDB(); } public override void Unload(bool shutdown) { Command.Unregister(Command.Find("XP")); } ColumnDesc[] createLevels = new ColumnDesc[] { new ColumnDesc("Name", ColumnType.VarChar, 16), new ColumnDesc("XP", ColumnType.Int32), new ColumnDesc("Level", ColumnType.Int32), }; void InitDB() { Database.CreateTable("Levels", createLevels); } } public sealed class CmdXP : Command2 { public override string name { get { return "XP"; } } public override string type { get { return "economy"; } } int GetInt(string s) { return s == "" ? 0 : int.Parse(s); } /// <summary> /// The amount of XP required until the player reaches the next level. /// </summary> int nextLevel(int userLevel) { return calculateLevel(userLevel + 1); } /// <summary> /// Calculates the amount of XP required to reach a specific level. /// </summary> int calculateLevel(int level) { // XP = (Level / 0.02) ^ 2 return (int)(Math.Pow(level / 0.02, 2) / 100); } /// <summary> /// Checks to see whether or not the player has levelled up. /// </summary> int checkLevelUp(int curXP, int number) { // level = floor((0.02 √(curXP + number)) 10) double xp = (0.02 Math.Sqrt(curXP + number)) 10; return (int)Math.Floor(xp); } /// <summary> /// Checks to see whether or not the player has levelled down. /// </summary> int checkLevelDown(int curXP, int number) { if ((curXP - number) <= 0) return 0; // level = floor((0.02 √(curXP + number)) 10) double xp = (0.02 Math.Sqrt(curXP - number)) 10; return (int)Math.Floor(xp); } public override void Use(Player p, string message, CommandData data) { p.lastCMD = "secret"; string[] args = message.SplitSpaces(); if (args[0] == "secretcode") { // To add XP: /xp secretcode [name] [xp] if (args.Length < 3) { Help(p); return; } if (PlayerInfo.FindMatchesPreferOnline(p, args[1]) == null) return; List<string[]> rows = Database.GetRows("Levels", "Name, XP, Level", "WHERE Name=@0", args[1]); int number = int.Parse(args[2]); if (rows.Count == 0) { int curXP = 0; int newLevel = checkLevelUp(curXP, number); Player pl = PlayerInfo.FindExact(args[1]); // Find person receiving XP int curLevel = 0; if (pl != null && curLevel != newLevel) pl.Message("You are now level &b" + newLevel); Database.AddRow("Levels", "Name, XP, Level", args[1], args[2], newLevel); return; } else { int curXP = int.Parse(rows[0][1]); // First row, second column int newLevel = checkLevelUp(curXP, number); Player pl = PlayerInfo.FindExact(args[1]); // Find person receiving XP int curLevel = GetInt(rows[0][2]); if (pl != null && curLevel != newLevel) p1.SetPrefix; pl.Message("You are now level &b" + newLevel); Database.UpdateRows("Levels", "XP=@1", "WHERE NAME=@0", args[1], curXP + number); // Give XP Database.UpdateRows("Levels", "Level=@1", "WHERE NAME=@0", args[1], newLevel); // Give level } } else { string pl = message.Length == 0 ? p.truename : args[0]; List<string[]> rows = Database.GetRows("Levels", "Name,XP,Level", "WHERE Name=@0", pl); int userLevel = rows.Count == 0 ? 0 : int.Parse(rows[0][2]); // User level int curXP = rows.Count == 0 ? 0 : int.Parse(rows[0][1]); // User XP if (message.Length 0 || args[0] p.name) { p.Message("&eYour Information:"); } else { if (PlayerInfo.FindMatchesPreferOnline(p, args[0]) == null) return; p.Message("&b" + args[0] + "&e's Information:"); } if (userLevel == 100) { p.Message("&5Level: &6" + userLevel + " (&bmax level)"); } else { p.Message("&5Level: &6" + userLevel + " (&b" + curXP + "xp/" + nextLevel(userLevel) + "xp&6)"); } } } public override void Help(Player p) { p.Message("&T/XP - &HShows your level and current XP needed to level up."); p.Message("&T/XP [player] - &HShows [player]'s level and current XP needed to level up."); p.Message("&T/XP [secret code] [player] [xp] - &HGives [player] XP."); } } }
-
I am accepting plugin requests
It doesn't work. Code: if (pl != null && curLevel != newLevel) p1.SetPrefix; pl.Message("You are now level &b" + newLevel); Error: plugins/XP.cs(133,61): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement Compiled using: mcs -target:library -r:MCGalaxy_.dll -out:plugins/XP.dll plugins/XP.cs In case you were wondering, the command was run from the MCGalaxy root folder.
-
Downvote Button
Ah, so the 'dumb' reaction will reduce the rep, right?
-
I am accepting plugin requests
How do you do that?
-
I am accepting plugin requests
I also noticed that when I use /xp give [code] [amount] and the player levels up FormatPrefix doesn't change the number at the beginning. I've restarted the server to no avail.
-
Downvote Button
I have noticed, with the new major forum update, that you aren't able to downvote posts. This makes earning reputation a snap, and makes the 'Schoolkid' and 'Chromie' ranks obsolete. You have no way of distinguishing which comments are useful or not. Bring back the downvote button!
-
DiscordVerify Plugin Error - MCGalaxy
Compiling this plugin (Link: https://github.com/ClassiCube/MCGalaxy-Plugins/blob/master/plugins/features/DiscordVerify.cs) shows no errors, but upon loading, this error occors. You can go bug Venk about DiscordVerify failing to load. An unknown error occured. Details in the error log. Error loading plugins from plugins/DiscordVerify.dll !!!Error (Sharing violation on path /home/rain/Software/MCGalaxy/plugins/DiscordVerify/verified.txt) - See Logs tab for more details Looking at the logs yields this: Type: IOException Source: mscorlib Message: Sharing violation on path /home/rain/Software/MCGalaxy/plugins/DiscordVerify/verified.txt Trace: at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001ef] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions) at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) [0x00061] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 at (wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string,System.Text.Encoding) at MCGalaxy.PlayerExtList.Load (System.String path, System.Char separator) [0x00040] in <aac90df087464427b1873dde33a35dd1>:0 at Core.DiscordVerify.Load (System.Boolean startup) [0x00035] in <c46bf3176e184f1e99e2e98fd3e75500>:0 at MCGalaxy.Plugin.Load (MCGalaxy.Plugin pl, System.Boolean auto) [0x000d0] in <aac90df087464427b1873dde33a35dd1>:0 at MCGalaxy.Scripting.IScripting.LoadPlugin (System.String path, System.Boolean auto) [0x00047] in <aac90df087464427b1873dde33a35dd1>:0 at MCGalaxy.Scripting.ScriptingOperations.LoadPlugins (MCGalaxy.Player p, System.String path) [0x00017] in <aac90df087464427b1873dde33a35dd1>:0 Is anyone able to help with this?
-
I am accepting plugin requests
Do I need to change them in order to show the xp/flair?
-
I am accepting plugin requests
When compile using mcs and linking in _MCGalaxy.dll it shows this error: plugins/FormatPrefix.cs(48,35): error CS0103: The name `Database' does not exist in the current context How do you fix this?
-
I am accepting plugin requests
Can you make a plugin that shows the player's XP in front of their name? Also can you add a /flair command similar to NA2's? Thanks.
- Texture Help!
- Texture Help!
- Texture Help!
- MCGalaxy Discord Relay Bot
- MCGalaxy Discord Relay Bot
- MCGalaxy Discord Relay Bot
-
MCGalaxy Discord Relay Bot
I wanted to make a discord relay bot for my server, so I followed this guide: https://github.com/ClassiCube/MCGalaxy/wiki/Discord-relay-bot. However, on server startup, it said Error sending request to Discord API (POST /channels/1393772596650053733/messages) !!!Error (The remote server returned an error: (403) Forbidden.) - See Logs tab for more details Discord API returned: {"message": "Missing Access", "code": 50001} And when I looked at logs, there seemed to be a long string of incomprehensible gibberish, which I have added below for your discretion. Type: WebException Source: System Message: The remote server returned an error: (403) Forbidden. Trace: at System.Net.HttpWebRequest.GetResponseFromData (System.Net.WebResponseStream stream, System.Threading.CancellationToken cancellationToken) [0x0017e] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0 at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Tas [TResult] workerTask, System.Int32 timeout, System.Action abort, S1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x00118] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0 at System.Net.HttpWebRequest.GetResponse () [0x00019] in <a85c1a570f9a4f9f9c3d2cfa5504e34f>:0 at MCGalaxy.Modules.Relay.Discord.DiscordApiClient.HandleNext () [0x000bc] in <f309205a56554c158910ca5ef34fa632>:0 Has anyone experienced this before or knows how to fix this? Thanks.
-
Idea for new blocks
Well, actually there is. You can add this command to your server (Link: https://github.com/NotAwesome2/Commands?tab=readme-ov-file#cmdboostcs), which will boost you up into the air when you run it or click a MB containing it. And having these custom blocks by default wouldn't go because this isn't some random Minecraft clone, it's replicating Minecraft Classic, which doesn't contain any blocks that you have mentioned.
-
MCGalaxy Help Hiding
Because it gives a secret award and if someone finds it in /help and runs it, then they wouldn't have 'earned' that award.
-
MCGalaxy Help Hiding
I have a secret command on MCGalaxy, but I want to hide it from people so they can't do /help on it or accidentally find the command. Also, as a bonus, is there a way to prevent them from using / again to see the command?