@CommandHelp(value = "Changes your worldId to a specific one.")
 @Command
 public boolean world(
     Player p,
     @CommandParameter(name = "World ID", description = "The target world id.") int worldId) {
   p.setWorld(worldId);
   return true;
 }
 @CommandHelp(value = "Creates a sample pickup.")
 @Command
 public boolean pickup(Player p) {
   Location location = p.getLocation();
   location.y += 10;
   SampObjectManager.get().createPickup(351, 15, location);
   return true;
 }
  @CommandHelp(value = "Creates a sample checkpoint.")
  @Command
  public boolean checkpoint(Player p) {
    Radius location = new Radius(p.getLocation(), 10);
    location.x += 10;

    p.setCheckpoint(
        Checkpoint.create(
            location,
            player -> {
              player.disableCheckpoint();
              player.playSound(1057);
            },
            null));

    return true;
  }
 @CommandHelp(value = "Sets the codepage of the player to a specific one.")
 @Command
 public boolean codepage(
     Player p,
     @CommandParameter(name = "Codepage ID", description = "The target codepage code.") int code) {
   p.setCodepage(code);
   return true;
 }
 @CommandHelp(value = "Changes your characters facing angle.")
 @Command
 public boolean angle(
     Player p,
     @CommandParameter(name = "Angle", description = "The target angle in degrees.") float angle) {
   p.setAngle(angle);
   return true;
 }
 @CommandHelp(value = "Changes your interior to a specific one.")
 @Command
 public boolean interior(
     Player p,
     @CommandParameter(name = "Interior ID", description = "The target interior id")
         int interiorId) {
   p.setInterior(interiorId);
   return true;
 }
  public static WlListDialog create(
      Player player, EventManager eventManager, AbstractDialog parent, RaceServiceImpl service) {
    PlayerStringSet stringSet = service.getLocalizedStringSet().getStringSet(player);
    TrackManagerImpl trackManager = service.getTrackManager();

    return WlListDialog.create(player, eventManager)
        .parentDialog(parent)
        .caption(stringSet.get("Dialog.TrackListMainDialog.Caption"))
        .item(
            stringSet.get("Dialog.TrackListMainDialog.Nearby"),
            (i) -> {
              List<Track> tracks = trackManager.getAllTracks();
              new TrackListDialog(player, eventManager, i.getCurrentDialog(), service, tracks)
                  .show();
            })
        .item(
            stringSet.get("Dialog.TrackListMainDialog.MyFavorites"),
            (i) -> {
              List<Track> tracks = trackManager.getAllTracks();
              new TrackListDialog(player, eventManager, i.getCurrentDialog(), service, tracks)
                  .show();
            })
        .item(
            stringSet.get("Dialog.TrackListMainDialog.MyTracks"),
            (i) -> {
              List<Track> tracks = trackManager.searchTrackByAuthor(player.getName());
              new TrackListDialog(player, eventManager, i.getCurrentDialog(), service, tracks)
                  .show();
            })
        .item(
            stringSet.get("Dialog.TrackListMainDialog.SearchByAuthor"),
            (i) -> {
              String caption = stringSet.get("Dialog.TrackSearchByAuthorDialog.Caption");
              String message = stringSet.get("Dialog.TrackSearchByAuthorDialog.Text");
              WlInputDialog.create(player, eventManager)
                  .parentDialog(i.getCurrentDialog())
                  .caption(caption)
                  .message(message)
                  .onClickOk(
                      (d, text) -> {
                        player.playSound(1083);

                        List<Track> tracks = trackManager.searchTrackByAuthor(text);
                        new TrackListDialog(
                                player, eventManager, i.getCurrentDialog(), service, tracks)
                            .show();
                      })
                  .build()
                  .show();
            })
        .item(
            stringSet.get("Dialog.TrackListMainDialog.SearchByKeyword"),
            (i) -> {
              String caption = stringSet.get("Dialog.TrackSearchByKeywordDialog.Caption");
              String message = stringSet.get("Dialog.TrackSearchByKeywordDialog.Text");
              WlInputDialog.create(player, eventManager)
                  .parentDialog(i.getCurrentDialog())
                  .caption(caption)
                  .message(message)
                  .onClickOk(
                      (d, text) -> {
                        List<Track> tracks = trackManager.searchTrackByName(text);
                        new TrackListDialog(
                                player, eventManager, i.getCurrentDialog(), service, tracks)
                            .show();
                      })
                  .build()
                  .show();
            })
        .onClickOk((d, i) -> player.playSound(1083))
        .build();
  }
 @CommandHelp(value = "Teleports you to a target player.")
 @Command
 public boolean tp(Player p, Player target) {
   p.setLocation(target.getLocation());
   return true;
 }
 @CommandHelp(value = "Teleports you to a specific position on the map.")
 @Command
 public boolean tp(Player p, float x, float y, float z) {
   p.setLocation(x, y, z);
   return true;
 }
 @CommandHelp(value = "Changes your drunk level to 50000 and makes you drunk.")
 @Command
 public boolean drink(Player p) {
   p.setDrunkLevel(50000);
   return true;
 }
 @BeforeCheck
 public boolean checkPremission(Player p, String cmd, String params) {
   return p.isAdmin();
 }
 /** @return The associated hitted Player / victim for this event. */
 public Player getHitPlayer() {
   return Player.get(hitId);
 }