Jump to content

Suggestion - ACV1


WaterIsIllegal

Recommended Posts

Hi. This suggestion could be a way to make HB/smoke/rope dart reports a lot easier.

When someone shoots you with a HB, there should be a message that says: "You've been hb'ed by Mainblast!", "Mainblast has used smoke on you!" or "Alien pulled you with a rope dart".

It's for ACV1, (obviously :P) and I think this should be implemented.

Link to comment
Share on other sites

  • 3 months later...

Hey, sorry for bumping this suggestion but well, I think it is a problem which still needs to be solved.

We could follow two paths to fix this "bug", both of them need @brunyman as a developer to do it:

1. We have to check how the WorldGuard API works and see if there is any code which lets you know in which region you are (I think there is). If yes, Bruny, has to add in the HB/Smoke/etc code a checker to see if a player is in a region forbiden to use those items. If yes: they wont work.

2. This is simpler but wont fix the problem: just add a line of code that will be sent to the target saying who used HB/Smoke/etc on them. (This wont fix the error, but if Bruny cant find the way of implementing the first path: this will make reports and bans easier!

Edit:

On spigot some people used this code for World Guard (https://www.spigotmc.org/threads/worldguard-checking-if-players-in-a-region.67426/):

                    for(ProtectedRegion r : WGBukkit.getRegionManager(p.getWorld()).getApplicableRegions(p.getLocation())) {
                        if (r.getId().equalsIgnoreCase("ACv1_Spawn")) {
                         return; // Also there could be a World Guard flag checker to see if the region has PVP enabled or not, instead getting the region the player is in
                        }
				        if ((p.getGameMode() == GameMode.CREATIVE)) {
					        return; // So staff on creative mode cant be affected
				        } 
                        // Do whatever code for HB/Smoke/etc
                    }

 

Also this code would check if the region the player is in has PVP enabled or not (https://www.spigotmc.org/threads/worldguard-api-check-if-player-can-pvp.226101/):

            if (Bukkit.getServer().getPluginManager().getPlugin("WorldGuard") != null){
                RegionManager regionManager = wg.getRegionManager(p.getWorld());
                ApplicableRegionSet set = regionManager.getApplicableRegions(p.getLocation());
                for (ProtectedRegion region : set) {
                    if (region != null){
                        if (!set.allows(DefaultFlag.PVP)) {
                            event.setCancelled(true);
                            return;
                        }
                    }
                }
            }

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site you agree to the following Terms of Use, Guidelines and Privacy Policy. 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.