Selim Posted March 30, 2014 Posted March 30, 2014 How to add it? I put adminadmin.java this code: case admin_tradeoff: try { String mode = command.substring(15); if(mode.equalsIgnoreCase("on")) { activeChar.setTradeRefusal(true); activeChar.sendMessage("Trade refusal enabled."); } else if(mode.equalsIgnoreCase("off")) { activeChar.setTradeRefusal(false); activeChar.sendMessage("Trade refusal disabled."); } } catch(Exception ex) { if(activeChar.getTradeRefusal()) { activeChar.setTradeRefusal(false); activeChar.sendMessage("Trade refusal disabled."); } else { activeChar.setTradeRefusal(true); activeChar.sendMessage("Trade refusal enabled."); } } and to pcinstance.java this: //Line 1202 private boolean _tradeRefusal = false; //Line 14245 public void setTradeRefusal(boolean mode) { _tradeRefusal = mode; } public boolean getTradeRefusal() { return _tradeRefusal; } Compile succes, admin comand in panel when i use it i see sysmsg "trade refusal enabled/disabled" but i still can give trade to gm, i think i must add somethink else to activate it to work but i dont know what and where :/
0 Selim Posted March 30, 2014 Author Posted March 30, 2014 Ok i fix it, don't know if is good but all work fine ;p i add to traderequest.java this code: if (partner.getTradeRefusal()) { player.sendMessage("Target is in trade refusal mode."); player.sendPacket(ActionFailed.STATIC_PACKET); return; } When i use .tradeoff/tradeon all fine, but when i use admin comand tradeoff in admin panel it work fine but i have error in console like on screen, someone know what is wrong?
0 Nightw0lf Posted April 1, 2014 Posted April 1, 2014 the error searching for the next token but there is not put it or delete the code and make it proper
0 Selim Posted April 2, 2014 Author Posted April 2, 2014 Y ok, so maybe you can give me right code for it?
Question
Selim
How to add it?
I put
adminadmin.java this code:
case admin_tradeoff: try { String mode = command.substring(15); if(mode.equalsIgnoreCase("on")) { activeChar.setTradeRefusal(true); activeChar.sendMessage("Trade refusal enabled."); } else if(mode.equalsIgnoreCase("off")) { activeChar.setTradeRefusal(false); activeChar.sendMessage("Trade refusal disabled."); } } catch(Exception ex) { if(activeChar.getTradeRefusal()) { activeChar.setTradeRefusal(false); activeChar.sendMessage("Trade refusal disabled."); } else { activeChar.setTradeRefusal(true); activeChar.sendMessage("Trade refusal enabled."); } }and to pcinstance.java this:
//Line 1202 private boolean _tradeRefusal = false; //Line 14245 public void setTradeRefusal(boolean mode) { _tradeRefusal = mode; } public boolean getTradeRefusal() { return _tradeRefusal; }Compile succes, admin comand in panel when i use it i see sysmsg "trade refusal enabled/disabled" but i still can give trade to gm, i think i must add somethink else to activate it to work but i dont know what and where :/
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now