i need this, please if anyone know ,how can i get && check last packet received by player? for example i want check if last packetreceived by player is Movepk, echo " Testing "; thanks a lot to Helpers.
public function onDataPacketRevice(DataPacketReceiveEvent $event){ if($event->getPlayer() instanceof Player) { // ik its player . just to make sure if($event->getPacket() Instanceof MovePlayerPacket) echo "testing"; } } }
no no, i want get last packet, i dont want check if player received Movepk echo stuff, please read thread a gain.
public function onDataPacketRevice(DataPacketReceiveEvent $event){ $this->array[$player->getName()] = $event->getPacket(); } use this to check : if(isset($this->array[$player->getName()]) && $this->array[$player->getName()] instanceof MovePlayerPacket)) echo "text";
done, i looked at your plugin chatUnderName and i see how do you get lastMessage, you save it to array, now im doing that, it should solved, thank you anyway.