0flee Posted March 15, 2021 Posted March 15, 2021 Hello, i put my ".menu" with trade option. Disabled/Enables. 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 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 if (player.getVariables().getBoolean("trade_off", false)) { player.sendMessage("[Trade Refuse]: Player in refusal trade."); return; } EnterWorld.java 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. I use L2j-Mobius. Maybe someone can help. Greeings & Thank you!
0 Zake Posted March 15, 2021 Posted March 15, 2021 1 hour ago, 0flee said: It is false, i should to true? No work...:/ try to debug this one, see if returns false and why. If this is a static false then just remove it
0 Kara Posted March 15, 2021 Posted March 15, 2021 (edited) L2PcInstance -> void cleanMe() and check if it store variables Edited March 15, 2021 by Kara
0 0flee Posted March 15, 2021 Author Posted March 15, 2021 on PlayerInstance, isn't void cleanMe() PlayerVariables.javahttps://pastebin.com/whEbyePd
0 0flee Posted March 15, 2021 Author Posted March 15, 2021 7 minutes ago, Zake said: maybe hasChanges() method returns false It is false, i should to true? No work...:/
Question
0flee
Hello, i put my ".menu" with trade option. Disabled/Enables. 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
TradeRequest.Java
EnterWorld.java
With this settings. if i put enable, after restart, it's still disabled. I use L2j-Mobius. Maybe someone can help. Greeings & Thank you!
6 answers to this question
Recommended Posts