Not sure why you are updating all players in the area to be like you.
Just check where the update is for settings the player into a npc and have it update the apperence to everyone else.
|
I have a weird issue with :: playnpc/pnpc it only shows the npc transform on my client and transforms others aswell just visable for me only
Example: https://gyazo.com/923c1e0fd6fb36491a00a1c3f13270c1
Not sure why you are updating all players in the area to be like you.
Just check where the update is for settings the player into a npc and have it update the apperence to everyone else.
It is clearly about you update the npc for every player on your end. It should be that it update just you for all players.
I would suggest to start going down how the command works. Then take a look at all the configs it sets. Then have a look at the player update with those config to figure out the issue.
If you are lazy in doing so, just perhaps share some code?
As arch said, it's because it's an owner/developer command more than likeyl and inside said code it's only updating for those ranks, share the code for the pnpc or either search for "owner" or "developer" or something along those lines inside the code.
Well here is my code for the command:
if (command[0].equalsIgnoreCase("pnpc")) {
String name = wholeCommand.substring(5);
player.setNpcTransformationId(Integer.parseInt(nam e));
player.getUpdateFlag().flag(Flag.APPEARANCE);
player.getPacketSender().sendMessage("You have transformed into ID: " + name);
}
And here is the other one thats linked to it
private int npcTransformationId;
public Player setNpcTransformationId(int npcTransformationId) {
this.npcTransformationId = npcTransformationId;
return this;
}
public int getNpcTransformationId() {
return npcTransformationId;
}
private final Appearance appearance = new Appearance(this);
If you were to look for 'npcTransformationId' or 'getNpcTransformationId()', this would take you to a method which has stuff like your apperence (such as hair color, armour etc). You'll then have to check everytime this apperence method is being send.
This is most likely being send in your player update. Then this method is being send somewhere aswell, this here could be where your issue could potentially be, if not before that.
Do you have any problem with displaying armour when you equip it? If not than have a look at how they update the appearance.
I have this.
if (player.getNpcTransformationId() <= 0) {
int[] equip = new int[equipment.capacity()];
for (int i = 0; i < equipment.capacity(); i++) {
equip[i] = equipment.getItems()[i].getId();
}
if (equip[Equipment.HEAD_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.HEAD_SLOT]);
} else {
properties.put(0);
}
if (equip[Equipment.CAPE_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.CAPE_SLOT]);
} else {
properties.put(0);
}
if (equip[Equipment.AURA_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.AURA_SLOT]);
} else {
if (equip[Equipment.AMULET_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.AMULET_SLOT]);
} else {
properties.put(0);
}
}
if (equip[Equipment.WEAPON_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.WEAPON_SLOT]);
} else {
properties.put(0);
}
if (equip[Equipment.BODY_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.BODY_SLOT]);
} else {
properties.putShort(0x100 + appearance.getLook()[Appearance.CHEST]);
}
if (equip[Equipment.SHIELD_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.SHIELD_SLOT]);
} else {
properties.put(0);
}
if (ItemDefinition.forId(equip[Equipment.BODY_SLOT]).isFullBody()) {
properties.put(0);
} else {
properties.putShort(0x100 + appearance.getLook()[Appearance.ARMS]);
}
if (equip[Equipment.LEG_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.LEG_SLOT]);
} else {
properties.putShort(0x100 + appearance.getLook()[Appearance.LEGS]);
}
if (ItemDefinition.forId(equip[Equipment.HEAD_SLOT]).isFullHelm() ||
ItemDefinition.forId(equip[Equipment.HEAD_SLOT]).isFullHelm1()) {
properties.put(0);
} else {
properties.putShort(0x100 + appearance.getLook()[Appearance.HEAD]);
}
if (equip[Equipment.HANDS_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.HANDS_SLOT]);
} else {
properties.putShort(0x100 + appearance.getLook()[Appearance.HANDS]);
}
if (equip[Equipment.FEET_SLOT] > -1) {
properties.putShort(0x200 + equip[Equipment.FEET_SLOT]);
} else {
properties.putShort(0x100 + appearance.getLook()[Appearance.FEET]);
}
if (appearance.getLook()[Appearance.BEARD] <= 0 || appearance.getGender().equals(Gender.FEMALE)) {
properties.put(0);
} else if (ItemDefinition.forId(equip[Equipment.HEAD_SLOT]).isFullHelm()) {
properties.put(0);
} else {
properties.putShort(0x100 + appearance.getLook()[Appearance.BEARD]);
}
}else {
properties.putShort(-1);
properties.putShort(player.getNpcTransformationId( ));
}
properties.put(appearance.getLook()[Appearance.HAIR_COLOUR]);
properties.put(appearance.getLook()[Appearance.TORSO_COLOUR]);
properties.put(appearance.getLook()[Appearance.LEG_COLOUR]);
properties.put(appearance.getLook()[Appearance.FEET_COLOUR]);
properties.put(appearance.getLook()[Appearance.SKIN_COLOUR]);
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |