Jump to content

Teleport sleepers from assigned zones to set coordinates.


Recommended Posts

Posted

I would like to eject sleepers from preset Zone Manager zones to specific coordinates.
I have raid islands on the edge of the map and simply ejecting sleepers will place them under water.

Posted (edited)

Hi, I have a potential solution for your issue, but it requires modifying the code in the ZoneManager plugin.
Please open the .cs file and look for the code section if (HasFlag(zone, ZoneFlags.EjectSleepers)).
Replace this section with the code I've provided.

Old code

if (HasFlag(zone, ZoneFlags.EjectSleepers))
{
   if (!CanBypass(player, ZoneFlags.EjectSleepers) && !IsAdmin(player))
   {
     EjectPlayer(player, zone);
     return;
   }
}

New Code

if (HasFlag(zone, ZoneFlags.EjectSleepers))
 {
    //if (!CanBypass(player, ZoneFlags.EjectSleepers) && !IsAdmin(player))
    if (!CanBypass(player, ZoneFlags.EjectSleepers))
    {
    //EjectPlayer(player, zone);
	TeleportPlayer(player, new Vector3(-1155.07f, 16.65f, -1327.94f));
    //return;
    }
	return;
}


Additionally, you should add a specific code enhancement above the method private void OnPlayerExitZone(BasePlayer player, Zone zone).

private void TeleportPlayer(BasePlayer player, Vector3 destination)
{
  if (player != null)
  {
    player.Teleport(destination);
  }
}



If you're not familiar with this kind of editing,
I can gladly send you the modified version of the plugin.

It's important that you insert your desired position in the TeleportPlayer(player, new Vector3(-1155.07f, 16.65f, -1327.94f)); function.
--> (-1155.07f, 16.65f, -1327.94f)

To determine the exact position, you can use my "MyPosi" plugin.

Whether this is the ultimate solution might be better judged by an experienced developer, but it works exactly as you want it to.

Edited by DeutscherRitterPlatz
  • Like 1

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
1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.8k

Files Sold

Total number of files sold.

2.1m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.