|
using ;; to start any command.Ok so first of all let me introduce what i'm releasing, this is really simple, yet no other 317 i've played managed to actually do this, and players from 718s really like this feature.
What you will be doing - First we will be making it so players can use ;; to use any command, on all 718s this is a basic feature but on 317s noone has this. Instead they have just :: to start a command. Not many people like using shift for it, so why not give both options.
First go to your client then find Client.java then find thisreplace it withCode:(inputString.startsWith("::"))Now players will be able to use ;;home to teleport home, or ;;yell to yell or ;;ban to ban (mods+ ban obv).Code:(inputString.startsWith("::") || inputString.startsWith(";;"))
Spoiler for Example of what you're adding:
Using ' to yell.
Now the next part, making it so players can yell using '. Example 'hello who wants to be reported?
In client.java add this above what we did earlier.Then on your vencillio source go to com.vencillio.rs2.entity.player.net.in.impl;Code:if (inputString.startsWith("'")) inputString = "::" + inputString;
open up CommandPacket and findand under it putCode:if (player == null) { return; }Then you will be able to yell using '.Code:if (parser.getCommand().startsWith("'")) { parser = CommandParser.create(" " + parser.toString().substring(1)); if (parser.hasNext()) { String message = ""; while (parser.hasNext()) { message += parser.nextString() + " "; } Yelling.yell(player, message, false); } return; }
Spoiler for Example of what you're adding:
Staffyell, only staff can see.
Now for the staff yell part, the name kind of already explains what it is but incase people don't know, it is just a yell that only staff can see.
Go to package com.vencillio.rs2.content;
open up Yelling.java replace thiswithCode:public static void yell(Player player, String message)FindCode:public static void yell(Player player, String message, boolean staffyell)Above it addCode:else if (rights == 5)Now go to the bottom and replace thisCode:} else if (staffyell) { send = "[<shad=0><col=FF0202>Staff Yell</shad></col>] <img=11> " + player.getUsername() + "</col>:<shad=0><col=FF0202> " + message;withCode:for (Player i : World.getPlayers()) if (i != null && send != null) i.getClient().queueOutgoingPacket(new SendMessage(send));It will look like this for non staff. ( btw i changed my rights to make it go in order so hence the right >=7 for anyone using the vencillio rights system default just change it accordingly.)Code:for (Player i : World.getPlayers()){ if (i != null && i.getRights() >=7 && staffyell) { i.send(new SendMessage(send)); } else if (i != null && !staffyell){ i.send(new SendMessage(send)); }
Next go to package com.vencillio.rs2.entity.player.net.in.command.imp l;
and open up PlayerCommand.java and look for this in your yell command.replace it withCode:Yelling.yell(player, message.trim() );Then add the staff yell command.Code:Yelling.yell(player, message.trim(), false);
Once again i've changed the rights system around so change the #7 to fit your staff rights, think vencillio og is mod = 1, admin = 2 , owner = 3.Code:case "s": if (player.getRights() >=7) { if (parser.hasNext()) { try { String message = parser.nextString(); while (parser.hasNext()) { message += " " + parser.nextString(); } Yelling.yell(player, message.trim(), true); } catch (Exception e) { player.getClient().queueOutgoingPacket(new SendMessage("Invalid yell format, syntax: -messsage")); } } } return true;
Spoiler for What it looks like to non staff.:
Spoiler for What it looks like to staff.:
I know this is all simple stuff, but it is very useful.
If you have any problems post them down below and i'll try to help as much as possible
Very simple things but I can guarantee someone new to the forums or rsps development in general would find it very useful. Thanks for your contributions man.
amazing so simple never thought of this, million times i done ;; by accident so much command fails thanks alot dude!!!
Thanks for this. some will use!
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
Tags for this Thread |