Jump to content
  • 0
Sign in to follow this  
thebadman

Adding limitations for Iron Man mode

Question

Hi guys i have added game modes for my server such as iron man and was wondering if some can help as I can't figure out a way to disable trading and drop trading, also preventing them from participating in pvp.
Help would be much appreciated :P Edited by thebadman

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
Ahem... Remove the trading option via right click and replace corresponding methods. Shouldn't be hard at all.

Share this post


Link to post
Share on other sites
  • 0
you could just have a boolean variable '[COLOR="#FF0000"]isIronMan[/COLOR]' stored for each player and then perform a check:

[CODE]
if (!isIronMan){
// trade , pickup drops left on the ground by other people , etc
}
else{
// you cannot trade/etc on an ironman account
}
[/CODE]

Share this post


Link to post
Share on other sites
  • 0
[quote name='Game Master']Ahem... Remove the trading option via right click and replace corresponding methods. Shouldn't be hard at all.[/QUOTE]
Sorry i'm a noob to this how would i do that?

[quote name='A Duck Tale']you could just have a boolean variable '[COLOR="#FF0000"]isIronMan[/COLOR]' stored for each player and then perform a check:

[CODE]
if (!isIronMan){
// trade , pickup drops left on the ground by other people , etc
}
else{
// you cannot trade/etc on an ironman account
}
[/CODE][/QUOTE]
And where would i put this? in player.java? and is that the exact code?
Thank you both for helping

Share this post


Link to post
Share on other sites
  • 0
wouldnt have a clue on the exact code without looking at your source for your server. the [COLOR="#FF0000"]isIronMan[/COLOR] should be stored where all your other player variables are stored, and you would have to include it in your player saving/loading.

as for the mockup code i posted, it would go wherever the packets on your server were processed, and the real check would look something closer to:

[CODE]
if (packetId == TRADE_PACKET || packetId == FLOOR_ITEM_PACKET || packetId == WHATEVER_PACKET_YOU_WANT_TO_CHECK){
if(!isIronMan){
// handle the appropriate packet
}
else{
// write a game message stating you can't do it in ironman.
}
}
[/CODE] Edited by A Duck Tale

Share this post


Link to post
Share on other sites
  • 0
[quote name='A Duck Tale']wouldnt have a clue on the exact code without looking at your source for your server. the [COLOR="#FF0000"]isIronMan[/COLOR] should be stored where all your other player variables are stored, and you would have to include it in your player saving/loading.

as for the mockup code i posted, it would go wherever the packets on your server were processed, and the real check would look something closer to:

[CODE]
if (packetId == TRADE_PACKET || packetId == FLOOR_ITEM_PACKET || packetId == WHATEVER_PACKET_YOU_WANT_TO_CHECK){
if(!isIronMan){
// handle the appropriate packet
}
else{
// write a game message stating you can't do it in ironman.
}
}
[/CODE][/QUOTE]
I'm guessing it goes in the worldpacketsdecoder? i can't seem to get the code right, do you have skype so i can show you my source? i really appreciate you help

Share this post


Link to post
Share on other sites
  • 0
Rip the code from here?

[URL="http://www.run-server.org/runescape-development/rs2-server/snippets/581223-ironman-hc-ironman-modes.html"]Ironman[/URL]

Share this post


Link to post
Share on other sites
Sign in to follow this  

×