Jump to content
View in the app

A better way to browse. Learn more.

RuneSuite RSPS Development

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted
comment_13279

Pretty simple if you have a player and cant keep track of appeals/warnings.

Let's start off in PointsHandler:


/*
 * Warning Points
 */
private int warningPoints;

	public void setwarningPoints(int points, boolean add) {
		if(add)
			this.warningPoints += points;
		else
			this.warningPoints = points;
	}
	public int getWarningPoints() {
		return this.warningPoints;
	}
	public void incrementWarningPoints() {
		this.warningPoints++;
	}
	public void incrementWarningPoints(int amt) {
		this.warningPoints += amt;
	}
	public void setWarningPoints(int warningPoints) {
		this.warningPoints = warningPoints;
	}

Now we if they have more than 0 warning points they will get a notification on login.

PlayerHandler: (Under get minutes bonus XP method)

        if(player.getPointsHandler().getWarningPoints() == 10) {
        	World.deregister(player);
        	String p = player.getUsername().toLowerCase();
        	PlayerPunishment.autoban(p);
        }
        if (player.getPointsHandler().getWarningPoints() != 0) {
        player.getPA().sendMessage("@red@[AUTO-BAN] If you reach 10 Warning Points you will be Auto Banned.");
        player.getPA().sendMessage("@red@[AUTO-BAN] You currently have "+player.getPointsHandler().getWarningPoints()+" Warning Points.");
        }

Next we head to playerpunishment.

	public static void autoban(String player) {
		player = Misc.formatPlayerName(player.toLowerCase());
		if(!AccountsBanned.contains(player)) {
			addToFile(""+BAN_DIRECTORY+"Bans.txt", player);
			AccountsBanned.add(player);
		}
	}

Finally the command: (CommandPacketListener)

	if(command[0].contains("warn")) {
		String plr = wholeCommand.substring(5);
		Player playr2 = World.getPlayerByName(plr);
		if(playr2 != null) {
			playr2.getPointsHandler().setwarningPoints(1, true);
			playr2.getPA().sendMessage("@red@You have received 1 warning point!");
			playr2.getPointsHandler().refreshPanel();
			} else
			player.getPacketSender().sendMessage("Could not find player: "+plr);
	}

I left a bracket out, if you can't figure it out you probably shouldn't be reading this.

  • 1 year later...
  • 2 weeks later...
  • 4 months later...
  • 5 months later...
  • 3 years later...

Create an account or sign in to comment

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.