Skip to content

ClassId not allowed

Featured Replies

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

Solved by S-T-I-N-K-Y

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

????

But that way only classId 83 will be ported out

Edited by StinkyMadness

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

 

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)

  • Author
1 hour ago, StinkyMadness said:


if (player.getActiveClass() == 83)

OR

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

Thanks how do multiple? like 97 98 classes?

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

  • Author
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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.