Jump to content

Question

Posted (edited)

Hey what i do wrong? all import good need get classid and if match then teleport to town.
         

@Override
	protected void onEnter(Creature Creature)
	{
		Creature.setInsideZone(ZoneId.FLAG, true);
		if (Creature instanceof Player)
		{
			Player player = Creature.getActingPlayer();
			PvpFlagTaskManager.getInstance().remove(player);
			noblesse.getEffects(player, player);
			player.updatePvPFlag(1);
			((Player) Creature).sendMessage("AUTO NOBLESS ON");
			Creature.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
			
			// THIS ZONE WRONG
			if (player.getClassId() && 83)
				player.teleToLocation(Rnd.get(82833, 83000),Rnd.get(148605, 148800),-3472, 0);
				player.sendMessage("Your class is not allowed in the PvP zone.");
			    return;
		}
	}

error:
 

     Bad operand types for binary operator '&&'
    [javac] 			if (player.getClassId() && 83)
    [javac]   first type:  ClassId

 

Edited by martuxas1

7 answers to this question

Recommended Posts

  • 0
Posted
Just now, martuxas1 said:

Thanks how do multiple? like 97 98 classes?


maybe ways xD

if (player.getActiveClass() == 83 || player.getActiveClass() == 97 || player.getActiveClass() == 98)

  • 0
Posted
1 hour ago, StinkyMadness said:

if (player.getClassId() && 83) 
>
if (player.getClassId() == 83)

????

But that way only classId 83 will be ported out

i try it and try =! always error
 

Error: incomparable types: ClassId and int
    [javac]             if (player.getClassId() == 83)
    [javac]                                     ^
    [javac] 1 error

 

  • 0
Posted
1 minute ago, martuxas1 said:

i try it and try =! always error
 


Error: incomparable types: ClassId and int
    [javac]             if (player.getClassId() == 83)
    [javac]                                     ^
    [javac] 1 error

 


if (player.getActiveClass() == 83)

OR

if (player.getClassId().getId() == 83)

  • 0
Posted
1 hour ago, StinkyMadness said:


if (player.getActiveClass() == 83)

OR

if (player.getClassId().getId() == 83)

Thanks how do multiple? like 97 98 classes?

  • 0
Posted
1 hour ago, StinkyMadness said:


maybe ways xD

if (player.getActiveClass() == 83 || player.getActiveClass() == 97 || player.getActiveClass() == 98)

Thanks working ! :)

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock