Jump to content
  • Sign Up
Venk

Now Accepting Plugin Requests

Recommended Posts

8 minutes ago, Goodly said:

I was just echoing what Unk told me when I asked him how I could do it ages ago. Source code would be appreciated

public override void Load(bool auto)
{
    OnPlayerFinishConnectingEvent.Register(HandleOnPlayerFinishConnecting, Priority.High);
}

public override void Unload(bool auto)
{
    OnPlayerFinishConnectingEvent.Unregister(HandleOnPlayerFinishConnecting);
}

private void HandleOnPlayerFinishConnecting(Player p)
{
    if (!LevelInfo.AllMapNames().Contains(map))
    {
        p.Message("&WThe map you were on no longer exists!");
        return;
    }


    Level lvl = LevelInfo.FindExact(map);
    if (lvl == null)
    {
        if (!Server.Config.AutoLoadMaps)
            return;

        string propsPath = LevelInfo.PropsPath(map);
        LevelConfig cfg = new LevelConfig();
        cfg.Load(propsPath);

        AccessController visitAccess = new LevelAccessController(cfg, map, true);
        if (!visitAccess.CheckDetailed(p, p.Rank)) return;

        lvl = LevelActions.Load(p, map, false);

        if (lvl == null)
        {
            p.Message("&WFailed to load the map you were on!");
            return;
        }
    }

    bool canJoin = lvl.CanJoin(p);
    //We are joining a level right? As it's not the main level.
    OnJoiningLevelEvent.Call(p, lvl, ref canJoin);
    if (!canJoin) return;

    p.level = lvl;
}

Most of it is fluff for checking if player even has permissions to be in the map they were on or if the level exists and to load it if not loaded. Also this snippet doesn't work as-is because I have yet to complete the plugin, which is for making player join at previous location.

  • Winner 2

Share this post


Link to post
On 8/7/2024 at 1:38 AM, MasterlazorX said:

I understand it will probably go against this disclaimer, but hear me out, I'd like to see an improved plugin that is based off of 1ToastyBred1's Last Location plugin.

I've implemented this plugin to my server, modified with my flair, moved the "LastLocations" folder to go in the plugins folder and to have have a list of specific maps of where I don't want players to be teleported to when they rejoin (they will just join in at the server main instead) and I find it very useful, but there's 2 things I'd like changed of which I've attempted, but don't have the technical knowledge or the time to do it myself and making it work.

1. When player joins, they should be sent straight to the level of their last location, instead of spawning them in main as usual, having to do Thread.Sleep for a short time, and then changing their level and teleporting them to their last position.

2. There should be an option for the player to toggle whether they want to teleport to the last location in the map they left off at or spawn in the server main. (Maybe have a config on which should be default set by server owner?)

I have chosen to write the plugin from scratch. You can see my implementation here. I have only implemented the first change as I didn't want to bother storing options for each player in regards to settings. In addition because of how I implemented the plugin existing player data is incompatible. Along with this you can make it so players don't join back to certain maps by adding -lastpos to the MOTD.

  • Winner 1

Share this post


Link to post

A plugin that can play a sound from a library (that would be included with the plugin) using a clientside command would be great. Using cef for sound effects in nas is a nightmare, so a simpler way of playing them would be excellent

Share this post


Link to post
1 hour ago, PotionPro32 said:

A plugin that can play a sound from a library (that would be included with the plugin) using a clientside command would be great. Using cef for sound effects in nas is a nightmare, so a simpler way of playing them would be excellent

This is honestly out of scope, as that also would require a ClassiCube plugin and would also require a ton of work to make such a plugin.

Share this post


Link to post
On 8/5/2024 at 2:22 PM, LJplays said:

Could you make a nudge/move command where you select and area like cuboid, then using the arrow keys/command hotkeys you can move the structure until you deselect it.

This was a great suggestion and lot of fun to make, here you go.

I opted for using the number pad arrows for moving left/right/forward/backward and number pad + and - for moving up/down. For convenience, I also made it so the hotkeys take the direction you're looking at into account, and also added an increment option (/moveselection <number>) to move more than 1 block per movement. Enjoy!

Share this post


Link to post

Working chest when right clicked sends a message in chat telling you what items and how many are there

Share this post


Link to post
15 hours ago, Kricpy said:

Working chest when right clicked sends a message in chat telling you what items and how many are there

What would the point even be? There is no item system that is required for this to even function in the first place.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...