Jump to content
  • 0

ClassId not allowed


martuxas1

Question

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
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
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)

Link to comment
Share on other sites

  • 0

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

????

But that way only classId 83 will be ported out

Edited by StinkyMadness
Link to comment
Share on other sites

  • 0
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

 

Link to comment
Share on other sites

  • 0
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)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...