L2JMobius

High Five .menu ( Trade )

oRiGiNaL · 2 · 2433

Offline oRiGiNaL

  • Black Sheep
  • Knight
  • ***
    • Posts: 68
Hello, i put my ".menu" with trade option. Disabled/Enabled. And method work, block trade request or allow. Depends on state.
And i want to save this choice of player on character_variables. I put as fallow on
.manu
 

Code: [Select]
case "trade":
if (!activeChar.getVariables().getBoolean("trade_off", false))
{
activeChar.setTradeRefusal(true);
activeChar.getVariables().set("trade_off", true);
activeChar.sendMessage("[Blocked Trade]: Enabled !");
}
else
{
activeChar.setTradeRefusal(false);
activeChar.getVariables().set("trade_off", false);
activeChar.sendMessage("[Blocked Trade]: Disabled !");
}
break;

TradeRequest.Java

 

Code: [Select]
if (player.getVariables().getBoolean("trade_off", false))
{
player.sendMessage("[Trade Refuse]: Player in refusal trade.");
return;
}

EnterWorld.java

      
Code: [Select]
if (player.getVariables().getBoolean("trade_off", false))
{
player.setTradeRefusal(true);
player.sendMessage("[Blocked Trade]: Enabled !");
}


With this settings. if i put enable, after restart, it's still disabled.. Maybe someone can help.  Greeings & Thank you!


Offline oRiGiNaL

  • Black Sheep
  • Knight
  • ***
    • Posts: 68
I reply myself, amazing. Well, i find how work. If i put tradeoff Enabled, i should give trade from another char. Then rr and it's stored.