Jump to content

No hide on PVP God

Closed 1.0.1

Stampy
Stampy

Posted

When doing a zone how can i hide the PVP status as the only way i have managed it in a zone is with /zone safezone true this hides it but when pvpgod true flag it still shows PVP

Stampy

Posted

dont know if this will help you

bool InPVPZone(BasePlayer player)
{
    if (player.InSafeZone() || player.HasPlayerFlag(BasePlayer.PlayerFlags.SafeZone))
        return false;
    if (ZoneManager?.Call<bool>("PlayerHasFlag", new object[] { player, "PvpGod" }) == true)
        return false;
    return GetPlayerZoneIDs(player).Length > 0;
}
 

With this

void UpdateStatus(BasePlayer player, ForceMode mode = ForceMode.None)
{
    NextTick(() =>
    {
        if (player.HasPlayerFlag(BasePlayer.PlayerFlags.PvpGod))
            return;

        // Rest of the code to update status...
    });
}
 

But as it stands you are not compatible with Zone Flags other than safe zone flag this code should make it hide the status when the user enters a zone which has the flag PvpGod = True

Stampy

Posted

or better yet the instructions:

 

Inside the InPVPZone method, add a condition to check if the player has the PvpGod flag:

csharpCopy code

bool InPVPZone(BasePlayer player) { if (player.InSafeZone() || player.HasPlayerFlag(BasePlayer.PlayerFlags.SafeZone)) return false; if (ZoneManager?.Call<bool>("PlayerHasFlag", new object[] { player, "PvpGod" }) == true) return false; return GetPlayerZoneIDs(player).Length > 0; }

In the UpdateStatus method, add a condition to skip updating the status if the player has the PvpGod flag:

csharpCopy code

void UpdateStatus(BasePlayer player, ForceMode mode = ForceMode.None) { NextTick(() => { if (player.HasPlayerFlag(BasePlayer.PlayerFlags.PvpGod)) return; // Rest of the code to update status... }); }

With these modifications, when a player has the PvpGod flag set to true, their status will not be updated or displayed.

Note: It's important to ensure that the PvpGod flag is correctly implemented and set by the zone manager plugin you are using.

0xF

Posted

Hello, sorry for the lack of response, I did not receive notification of a new request.

As far as I understand the code that you gave you ChatGPT, but this code makes absolutely no sense, because the player's flags belong to the internal game flags, and the flag you are talking about belongs to the plugin zonemanager

Stampy

Posted

yes The flag is set to true but it still displays the Status 

0xF

Posted

/zone pvpgod true

0xF

Posted

/zone pvpgod false


image.thumb.png.2defd7784c2bd77152a690bdcd95c966.png

0xF

Posted

Hm

Are you running the latest version?

And try creating a new zone and check with it
/zone_add
/zone pvpgod true

Stampy

Posted

V1.01 and yeah doesn't work for me

0xF

Posted

Do you have DynamicPVP installed?

 

Stampy

Posted

is this something i need?

0xF

Posted

No, you don't have to, but it's something that can conflict with. In that case, I don't know what's causing it not to work for you. Try also to install the latest version of ZoneManager, maybe your version does not have the required api method

 

Stampy

Posted

i am using the latest 

0xF

Posted

Then I do not know, I can send you what I have. It works for me and disappears as soon as I write the command.

0xF

Posted

Changed Status from Pending to Closed

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.2k

Files Sold

Total number of files sold.

2m

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.