Jump to content

Question

Posted

hey guys can you tell me what is wrong with this  it gives basicly everywhere reward

if(isInsideZone(ZoneId.CUSTOMPVP))
				{
					sendMessage("is it working?");
					return;
				}
				else if (Config.ENABLE_PVP_FEATURES)
				{
					pvpReward();
				}

 

Recommended Posts

  • 0
Posted (edited)
24 minutes ago, haskovo said:

hey guys can you tell me what is wrong with this  it gives basicly everywhere reward

if(isInsideZone(ZoneId.CUSTOMPVP))
				{
					sendMessage("is it working?");
					return;
				}
				else if (Config.ENABLE_PVP_FEATURES)
				{
					pvpReward();
				}

 

 

if(Config.ENABLE_PVP_FEATURES && isInsideZone(ZoneId.CUSTOMPVP) )       
  {                     

pvpReward();            
   }               
 

Edited by Irrelevant
  • 0
Posted
1 hour ago, haskovo said:

it doesnt give anything now

make sure that you have create your custom zone in xml , if you dont know how you can check this : 

  

if  you want you can add this code  for easier creation :       

 

 

                                                                  

 

otherwise use the first guide and create your zone by hand.

 

 

also make sure that you have create your customzone.java in zone type to read your new zone properly. the path in java may be gameserver.model.zone.type.   depends your pack.

 

if you dont know how to do this, you can take example by :  

 

to see how you can add a zone in java + datapack.

 

 

 

  • 0
Posted (edited)

i have zone and it working it is respawning me gives me nobless etc

i think the problem is that its not checking who is in that zone which player

Edited by haskovo
  • 0
Posted (edited)
2 hours ago, haskovo said:

i have zone and it working it is respawning me gives me nobless etc

i think the problem is that its not checking who is in that zone which player

Player.java , method ---> onKillUpdatePvPKarma()

		/* 
		 * Basic antidual box check to avoid dual box farming pvp rewards
		 */
		Boolean checkIP = getClient().getConnection().getInetAddress().getHostAddress().equals(targetPlayer.getClient().getConnection().getInetAddress().getHostAddress());

		if(Config.ENABLE_PVP_FEATURES) {
		if (isInsideZone(ZoneId.CUSTOMPVP) && targetPlayer.isInsideZone(ZoneId.CUSTOMPVP) && !checkIP)
		{
			pvpReward();
		}else 
			return;
		}

 

Edited by LordPanic
  • 0
Posted
23 hours ago, haskovo said:

hey guys can you tell me what is wrong with this  it gives basicly everywhere reward

if(isInsideZone(ZoneId.CUSTOMPVP))
				{
					sendMessage("is it working?");
					return;
				}
				else if (Config.ENABLE_PVP_FEATURES)
				{
					pvpReward();
				}

 

 

21 hours ago, haskovo said:

i have zone and it working it is respawning me gives me nobless etc

i think the problem is that its not checking who is in that zone which player

Can you please explain your issue in plain English? Also consider mentioning the pack that you are using.

 

  • 0
Posted
if(isInsideZone(ZoneId.CUSTOMPVP)&&(Config.ENABLE_PVP_FEATURES))
{
 pvpReward();
 }
 else if (isInsideZone(ZoneId.CUSTOMPVP)&&(!Config.ENABLE_PVP_FEATURES))
{
sendMessage("Reward Disabled"); 
return

}

 

  • 0
Posted (edited)
1 hour ago, arm4729 said:
if(isInsideZone(ZoneId.CUSTOMPVP)&&(Config.ENABLE_PVP_FEATURES))
{
 pvpReward();
 }
 else if (isInsideZone(ZoneId.CUSTOMPVP)&&(!Config.ENABLE_PVP_FEATURES))
{
sendMessage("Reward Disabled"); 
return

}

 

not working i want when they are inside the pvp zone only then to get reward im using acis

Edited by haskovo
  • 0
Posted
On 7/1/2021 at 9:31 PM, haskovo said:

hey guys can you tell me what is wrong with this  it gives basicly everywhere reward

if(isInsideZone(ZoneId.CUSTOMPVP))
				{
					sendMessage("is it working?");
					return;
				}
				else if (Config.ENABLE_PVP_FEATURES)
				{
					pvpReward();
				}

 

It works everywhere cause your ifs are bad

On 7/1/2021 at 9:54 PM, Irrelevant said:

if(Config.ENABLE_PVP_FEATURES && isInsideZone(ZoneId.CUSTOMPVP) )       
  {                     

pvpReward();            
   }               

This is the correct way

  • 0
Posted (edited)

the pvpreward call is in pcInstance where is setting +1 pvp

 

private void pvpReward()
    {
        for (PvpReward pvpFeatures : PvpFeaturesTable.getInstance().getPvpRewardsTable())
        {
            if (Rnd.nextDouble() < pvpFeatures.getChance())
                addItem("Pvp Reward", pvpFeatures.getItemId(), pvpFeatures.getItemCount(), this, true);
        }
    }

Edited by haskovo
  • 0
Posted

Assuming your reward table is not empty, the problem is located at your zone file. Perhaps there is no setIsInsideZone(ZoneId.CUSTOMPVP) (onEnter method of the zone). Check it ...

System.out.println(String.format("Player is inside zone %s, Config: %s", isInsideZone(ZoneId.CUSTOMPVP),Config.ENABLE_PVP_FEATURES));
if(Config.ENABLE_PVP_FEATURES && isInsideZone(ZoneId.CUSTOMPVP))
	pvpReward();

 

Guest
This topic is now closed to further replies.


  • Posts

    • i'll give it a shot in a few hours and post it here
    • 🛡 GoldRush — High Five x20   A fresh High Five server focused on active progression, fair competition, and a healthy player-driven economy.   GoldRush is built for players who want a fresh spin on our beloved game that is connected to today's world via Web3 marketplace.   🌍 Server Info   Chronicle: High Five Type: Mid Rate / PvP Craft Community: International Location: Europe Time Zone: GMT+3   ⚙️ Rates   EXP: x20 SP: x20 Adena: x10 Drop: x8 Spoil: x12 Raid Boss: x3 Quest Items: x5 Quest EXP / SP: x10 Quest Adena: x5   👑 Class Progression   1st Class: Free 2nd Class: Free 3rd Class: 5,000,000 Adena   1st and 2nd class transfers reward Shadow Weapons.   ✨ Main Features   No P2W as there is no donation currency in the game Web3 Marketplace Events with real rewards Rotating accessories shop Weekly Olympiad Clean and active mid-rate progression   🧩 Community Board Features   Buffer GM Shop Gatekeeper Drop Search Rankings   🔨 Enchant Info   Max Weapon Enchant: +16 Max Armor Enchant: +12 Olympiad Max Enchant: +6   Safe Enchant: Weapons / Armor: safe to +3 Full Body Armor: safe to +4   Enchant Chance: +4 to +6: 66% +7 to +9: 60% +10 to +12: 54% +13 to +14: 48% +15 to +16: 42%   🏪 GM Shop / Gear Progression   C-grade through Dynasty gear is available through the GM Shop.   Moirai+ progression is farm, craft and raid based.   There is no admin-created endgame gear selling.   🥇 Gold Rush Economy   GoldRush includes a server-wide Adena sink system.   Players contribute Adena to the Gold Rush Collector. When the server goal is reached, limited Gold Bar stock unlocks through the Gold Merchant.   Daily Gold Rush missions also allow active players to earn Gold Bars through gameplay.   🌐 Website Player-to-Player Marketplace   GoldRush includes a website-based Web3 marketplace where players can list and trade items with each other.   Items come from real players.   The marketplace is player-to-player only.   🏛 Olympiad   Weekly Olympiad cycle. Olympiad starts at 18:00 GMT+3. Olympiad max enchant: +6.   🏰 Sieges   Castle sieges take place on Sundays at 16:00 and 20:00 GMT+3.   The first siege will happen 2 weeks after launch.   🐉 Grand Boss Respawn   Queen Ant: 24h + 2h random Core: 30h + 2h random Orfen: 48h + 2h random Baium: 120h + 3h random Antharas: 120h + 24h random Valakas: 120h + 24h random Beleth: 120h + 24h random   🎉 Events   Manual GM events with real token or gold bar rewards.   ⚔️ Fair Play   Bots are strictly forbidden and will result in a ban without warning.   Dualbox is limited to 1 box.   GoldRush is built around a healthy player-to-player economy.   🚀 What to Expect   Active farming Meaningful PvP Meaningul Farming Player-driven economy No donation currency     🔗 Join Us   Website: www.goldrushpvp.xyz Discord: https://discord.gg/kg9WXxcAY   🏁 Expected Launch: July 18 2026     If you are looking for a fresh High Five x20 server with clean structure and strong long-term potential, GoldRush is almost ready.   See you in game.
    • Collisions is from client are no way to bypass from server. Can be done from client modification need to be moded a .dll I can do the work you can contact me by DM  P.D: I already have this job done on the past
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..