Jump to content
Scriptss

Stopping Certain ranks trading certain items

Recommended Posts

Seen as no-one has released this, Just the shitty version of stopping ranks trading all together;

Version: 1.0
Knowledge needed: none
Revision: 317 project Insanity
Files edited: TradeAndDuel.java
What your adding: Your stopping a certain player rank from trading certain items


go to tradeandduel.java and find

[CODE]public boolean tradeable(int itemId) {[/CODE]

under it you should see

[CODE]for (int i : Config.ITEM_TRADEABLE) {
if(i == itemID) {
c.sendMessage("You can't trade this item.");
return false;
}
} [/CODE]


under that add

[CODE]for (int i : Config.DONOR_ITEMS) {
if (i == (itemID) && c.isDonator >= (1)) {
c.sendMessage("You can't trade this item.");
return false;
}
}[/CODE]



now open up config.java and add this anywhere with the rest of the ints

[CODE]public static final int[] DONOR_ITEMS = {####,#####,#####,######,#####,}; [/CODE]

"#####" is your item id

if you want to change the rank its for change "c.isdonator" to "c.playerRights" and ">=" to "==" Edited by officiallulzs3c
forgot a bracket

Share this post


Link to post
Share on other sites
Thank you for the tutorial!

Share this post


Link to post
Share on other sites
[code]
if (i == (itemID) && c.isDonator >= (1)) {
[/code]

Just curious why you put parenthesis around '1' and 'itemID'. Does the editor you're using automatically do that for you, or do you do that on your own?

Share this post


Link to post
Share on other sites
[quote name='Hope'][code]
if (i == (itemID) && c.isDonator >= (1)) {
[/code]

Just curious why you put parenthesis around '1' and 'itemID'. Does the editor you're using automatically do that for you, or do you do that on your own?[/QUOTE]

intellij automatically does it for me, not too sure why but yeah >_>

Share this post


Link to post
Share on other sites
Just added a couple of more loops to the millions already in PI :P

Good tutorial for beginners I guess...

Share this post


Link to post
Share on other sites
[quote name='krazykash']Just added a couple of more loops to the millions already in PI :P

Good tutorial for beginners I guess...[/QUOTE]

How would you propose its done then ? it cant be done any other way apart from re-writing actionhandler.java ,clickitem.java and trade.java

Your very critical of PI but the plain and simple fact is that its the best revision to grace the rsps scene

Share this post


Link to post
Share on other sites
[quote name='officiallulzs3c']How would you propose its done then ? it cant be done any other way apart from re-writing actionhandler.java ,clickitem.java and trade.java

Your very critical of PI but the plain and simple fact is that its the best revision to grace the rsps scene[/QUOTE]

I actually really love PI. It's the only source I like working with. I mean Hyperion and all that are amazing, nicely coded and etc and in comparison to PI with it's processes() and a million loop iterations, they kind of overshadow PI. I just think if people are going to release tutorials for PI they should work towards improving it not in the other direction.

Secondly, it can be done. By using slightly more sensible data structures than arrays so you don't have to loop over the whole damn thing every time!

Oh and also, it's not really a revision. Edited by krazykash

Share this post


Link to post
Share on other sites
[quote name='krazykash']I actually really love PI. It's the only source I like working with. I mean Hyperion and all that are amazing, nicely coded and etc and in comparison to PI with it's processes() and a million loop iterations, they kind of overshadow PI. I just think if people are going to release tutorials for PI they should work towards improving it not in the other direction.

Oh and also, it's not really a revision.[/QUOTE]

I hope you're not saying "all iterations are bad" and that you understand it's how you utilize them that sometimes makes for problems (be it slow processing or concurrent modification exceptions, etc)

Share this post


Link to post
Share on other sites
[quote name='krazykash']I actually really love PI. It's the only source I like working with. I mean Hyperion and all that are amazing, nicely coded and etc and in comparison to PI with it's processes() and a million loop iterations, they kind of overshadow PI. I just think if people are going to release tutorials for PI they should work towards improving it not in the other direction.

Secondly, it can be done. By using slightly more sensible data structures than arrays so you don't have to loop over the whole damn thing every time!

Oh and also, it's not really a revision.[/QUOTE]

I provided a [COLOR="#000000"][B][U]simple[/U][/B][/COLOR] tutorial for beginners to learn from and add to there server.

Im not going to go to the effort of teaching beginners how to re-write 3 files because they quite simply wouldn't be able to do it and the tutorial would be useless.

Nothing "overshadow's" PI, take a look at the toplist..., nearly every successful server on there is a PI whether it be loading 317 or 614.

People don't want to release efficient HQ tutorials because of the vast amount of leechers. Think about it, If someone released full castle wars, bounty hunter, stealing creation, fists of guthix, etc, [B][U][COLOR="#000000"]then every single server would have it[/COLOR][/U][/B].

I would release my version of netty but since netty got released in a spoonfed tutorial pretty much everyone is using it.


Same as project exhile, When raw envy released that loads of kids running servers off there home computers popped up and basically leeched the shit out of it.

Share this post


Link to post
Share on other sites
You should make donar items also unpickupable by normal players.

Share this post


Link to post
Share on other sites

×