Jump to content
  • Sign Up

Goodly

Moderator
  • Content Count

    521
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Goodly

  1. Using console type /promote [name]
  2. Goodly

    Random Worlds

    In addition to August's comment there's also an MCGalaxy wiki page about creating new levels. https://github.com/ClassiCube/MCGalaxy/wiki/Creating-levels
  3. If you just want to bring a player from one map to another map's spawnpoint, you should use a message block with /goto [map] in it. If you need more precise control over the destination in the other map, you should use a portal.
  4. The cancel argument only stops the level itself from being edited. The player will still see their change appear, but only on their screen. To fix this, you need to send a block change back to the player to visually undo the block they tried to place or delete. p.SendBlockchange((ushort)x, (ushort)y, (ushort)z, block);
  5. It's hard to say what's changed without an exact reference of when you were here before. UnknownShadow200 has done lot of work console ports; you can read about some of the supported systems here. I also recently added fancy lighting mode in the latest development build. Also, the ClassiCube terms of service have been updated in the last year or so. You can view them here https://www.classicube.net/terms/
  6. To show you're dedicating most of your videos to this game, do it. There is no special youtuber or content-creator role.
  7. I made changes and comments explaining the reasoning: using System; using MCGalaxy; using MCGalaxy.Events.ServerEvents; using MCGalaxy.Events.PlayerEvents; // REQUIRES THE LATEST VERSION OF MCGALAXY!!!!!!!!!!!!!!!!!!!!!!!!!!! namespace PluginToneIndicators { public sealed class ToneIndicators : Plugin { public override string name { get { return "tones"; } } // This should indicate the earliest version of MCGalaxy the plugin is compatible with, rather than the plugin's version // Unfortunately we must use the current version because the development build of MCGalaxy hasn't incremented the version number public override string MCGalaxy_Version { get { return "1.9.4.9"; } } public override string creator { get { return "AllergenX"; } } public override void Load(bool startup) { OnChatEvent.Register(OnChat, Priority.High); } public override void Unload(bool shutdown) { OnChatEvent.Unregister(OnChat); } public static void OnChat(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool relay) { //The general criticism is that you have a lot of code that is copy-pasted and doing the same thing. //This can be a problem because if you have to fix or change something, you have to be able to accurately //copy and paste that change into many places, which can be a common source of mistakes. //For instance, your original code had this: // // else if (msg.CaselessContains("/srs")) // { // const string removeString = "/nsrs"; // //Beause of the copy pasting of each tone, you forgot to change the if /srs to if /nsrs //To solve this, we can write a function that handles the parts that were copy pasted before, //and pass arguments for the parts that are different, for much less repeated text. if (HandleTone("/j", "joking", ref msg)) { return; } if (HandleTone("/s", "sarcasm", ref msg)) { return; } if (HandleTone("/hj", "half-joking", ref msg)) { return; } if (HandleTone("/srs", "serious", ref msg)) { return; } if (HandleTone("/nsrs", "not-serious", ref msg)) { return; } if (HandleTone("/r", "romantic", ref msg)) { return; } if (HandleTone("/t", "teasing", ref msg)) { return; } //^ If the given tone was handled, we're done, so we can quit the function early with return. //You could also use else-if. It's a personal preference IMO } // Returns true if the tone was found and the message was modified, otherwise false public static bool HandleTone(string tone, string prefix, ref string msg) { int toneStart = FindTone(tone, msg); if (toneStart == -1) { return false; } string startOfString = msg.Substring(0, toneStart); string endOfString = msg.Substring(toneStart + tone.Length); // Remove a space to prevent double spaces when removing a tone if (endOfString.Length > 0 && endOfString[0] == ' ') { endOfString = endOfString.Substring(1); } string cleanString = startOfString + endOfString; msg = ("&7[&a"+prefix+"&7] " + cleanString); return true; } // Returns the index of a tone if it was found, -1 if not found public static int FindTone(string tone, string msg) { int toneStart = msg.IndexOf(tone); if (toneStart == -1) { return -1; } //We need to make sure the tone isn't part of another word or tone. //Both sides of the word must either be a space, or the start/end of the message bool leftSideClear = false; bool rightSideClear = false; // Bonus info: when using || in if statements to do "OR", as soon as one of the conditions is true, it skips over the remaining ones. // This means that we do not have to do string bounds checking when looking at index -1 because // it's guaranteed that toneStart is not zero if (toneStart == 0 || msg[toneStart-1] == ' ') { leftSideClear = true; } if (toneStart + tone.Length == msg.Length || msg[toneStart+tone.Length] == ' ') { rightSideClear = true; } if (leftSideClear && rightSideClear) { return toneStart; } else { return -1; } } } }
  8. That's a cool idea. In my opinion it might look better if the tones within the brackets were lowercase Would you like constructive criticism on the code itself?
  9. To modify messages sent by players, use OnChatEvent and modify the ref "msg" argument. I believe you will need to be using the latest build of MCGalaxy to do this, though. You can find latest builds here: https://123dmwm.com/MCGalaxy/ https://github.com/ClassiCube/MCGalaxy/blob/master/MCGalaxy/Events/ServerEvents.cs#L107 For instance public static void OnChat(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool relay) { if (message.CaselessContains("sign")) msg += " I STEPPED ON THE SIGN!"; }
  10. There is no way to set a command permission only in a specific level. Allowing players to make custom blocks without having access to /lb generally (along with many other commands) is what /os is for. Players can use /os lb to create blocks in their realms.
  11. /mb [block] /z tnt |/mark 0 0 0 |/mark 20 20 20
  12. The ClassiCube client doesn't have a mod menu. If you're referring to something else it might help to clarify what you meant
  13. Click the image to see the list of ClassiCube's supported devices
  14. Yes. Using the server property "agree-to-rules-on-entry = true", you can prevent players from building or using commands before they agree to the rules. Then you can use a plugin to override the normal /rules agree behavior to require a password based on your specifications. Here is an example plugin. You would place this inside a file called forumpass.cs in your plugins folder, then use /pcompile forumpass , /pload forumpass using System; using MCGalaxy; using MCGalaxy.Events.PlayerEvents; using MCGalaxy.Commands; namespace Lol { public sealed class ForumPass : Plugin { public override string creator { get { return "Goodly"; } } public override string name { get { return "forumpass"; } } public override string MCGalaxy_Version { get { return "1.9.3.6"; } } public override void Load(bool startup) { OnPlayerCommandEvent.Register(OnPlayerCommand, Priority.Low); OnPlayerChatEvent.Register(OnPlayerChat, Priority.High); } public override void Unload(bool shutdown) { OnPlayerCommandEvent.Unregister(OnPlayerCommand); OnPlayerChatEvent.Unregister(OnPlayerChat); } static void OnPlayerCommand(Player p, string cmd, string args, CommandData data) { if (cmd.CaselessEq("rules")) { p.cancelcommand = true; if (args.CaselessEq("agree")) { if (!p.hasreadrules) { p.Message("You must read the rules before agreeing to them. Dimb ass."); return; } if (p.agreed) { p.Message("You already agreed to the rules."); return; } p.Message("To agree to the rules, you must enter /pass [pass] from your forum account."); return; } p.hasreadrules = true; //Since we are overriding the normal rules command, you must display the rules here via p.Message p.Message("Rules:"); p.Message("0. Make a forum account to play here."); p.Message("1. Don't make your level too difficult to join"); p.Message("2. TODO"); return; } if (cmd.CaselessEq("pass")) { p.cancelcommand = true; //the command /pass actually exists and does something else but we're going to hijack it because it is //one of the few commands that actually invokes OnPlayerCommand before the user has agreed to the rules if (p.agreed) { p.Message("You already correctly entered the password."); return; } if (!p.hasreadrules) { p.Message("&9You must read &T/Rules &9before entering the password."); return; } if (args.Length == 0) { p.Message("Please enter a password."); return; } if (args != GetPassword(p)) { p.Message("Incorrect password."); return; } p.Message("&6You've succesfully entered the password. Welcome!"); Command.Find("rules").Use(p, "agree"); return; //this return is only here in case you add other command cases below this if statement } } static string GetPassword(Player p) { //Modify this method for your requirements return p.name + "waow"; } static void OnPlayerChat(Player p, string message) { // Optionally mute players who haven't entered pass yet //if (!p.agreed) { p.Message("&cBefore speaking, you must read /rules then agree to them with /agree."); p.cancelchat = true; } } } } If you modify the file and want to reload the plugin, use /punload forumpass , then /pcompile forumpass, then /pload forumpass
  15. The webclient is currently broken. Unfortunately you can't do anything on your end to fix it. It should be fixed within a day or so. Until then you may still download the desktop client and play using that. UPDATE: It is now fixed.
  16. I wrote a page about creating levels: https://github.com/ClassiCube/MCGalaxy/wiki/Creating-levels
  17. First, you can use the source code for reference. Here is the PlayerAwards class: https://github.com/ClassiCube/MCGalaxy/blob/master/MCGalaxy/Modules/Awards/PlayerAwards.cs To use anything from the PlayerAwards class, you will have to add "using MCGalaxy.Modules.Awards;" at the top of your code file. Any method or field that is marked as "public" can be used by plugins and commands. You can use "PlayerAwards.Give" to give an award to a player, but this won't show a global chat message. If you want to show a global chat message, you should have console use the award give command. You can do that like this: const string myAward = "My Secret Award"; Command.Find("award").Use(Player.Console, "give "+p.name+" "+myAward); If you want to check if the player has the award already, you will have to get the list of awards for the player and then check if that list has the award inside of it. You can do that like this: bool hasAwardAlready = false; List<string> currentAwards = PlayerAwards.Get(p.name); if (currentAwards.CaselessContains(myAward)) { hasAwardAlready = true; } As a side note, you can shorten the above code like this: bool hasAwardAlready = PlayerAwards.Get(p.name).CaselessContains(myAward); Here is an example of everything so far put together. Remember you still need "using MCGalaxy.Modules.Awards;" at the top of the file. public override void Use(Player p, string message) { const string myAward = "My Secret Award"; bool hasAwardAlready = PlayerAwards.Get(p.name).CaselessContains(myAward); if (hasAwardAlready) { p.Message("You already found the secret!"); return; // When we write return, that will quit running the command so that the code below doesn't run } //Give the player the award if they haven't already gotten it Command.Find("award").Use(Player.Console, "give "+p.name+" "+myAward); }
  18. Goodly

    na2 ddos

    It stands for distributed denial of service. What this means is that someone uses a bunch of different computers (thousands) to connect to the server and overwhelm it so that it stops working
  19. Before you sign into the launcher, go to "Options" then "Mode", then click "Enhanced". After that, make sure all of these options are ON in Options -> Nostalgia Options escape menu.
  20. The forums are not for ban appeals
  21. Servers can send custom models so no client modification needed there. My main concern with attempting to develop any kind of fps mechanics is that the delay based netcode of classicube makes it kind of unsatisfying and difficult to play. At least for any sort of hitscan-type weapons. No custom sounds or camera feedback(shake, first person fire anim, etc) will also leave the gamefeel lacking. Oh yeah, alecdent mentioned this as well. Definitely doable if someone has the motivation to add it
  22. In general anything that requires the client itself to be modified for a new feature is probably not going to happen. The rest of what you've mentioned is doable if a developer is interested in it, but that's all server side stuff so it doesn't really have anything to do with AndrewPH or the core classicube dev 'team' (UnknownShadow200). Nothing relating to survival will ever officially be added to ClassiCube for brand reasons What is CS rotate?
  23. Why don't you ai-generate some updates for the game
×
×
  • Create New...