As title say, i want to make a gm shop just for premium users. I make code like this and witout premium i still can use. I put few logs, but don't work.
P.S. I use L2j-Sunrise.
package l2r.gameserver.model.actor.instance;import java.util.StringTokenizer;import l2r.gameserver.enums.InstanceType;import l2r.gameserver.model.actor.FakePc;import l2r.gameserver.model.actor.L2Npc;import l2r.gameserver.model.actor.templates.L2NpcTemplate;import l2r.gameserver.network.serverpackets.ActionFailed;import l2r.gameserver.network.serverpackets.NpcHtmlMessage;publicclass L2CustomShopInstance extends L2Npc
{@Overridepublicvoid showChatWindow(L2PcInstance player){
player.sendPacket(ActionFailed.STATIC_PACKET);NpcHtmlMessage html =newNpcHtmlMessage(getObjectId());
html.setFile(player, player.getHtmlPrefix(),"data/html/mods/shop/main.htm");
html.replace("%objectId%",String.valueOf(getObjectId()));
player.sendPacket(html);}/**
* @param template
*/public L2CustomShopInstance(L2NpcTemplate template){
super(template);
setInstanceType(InstanceType.L2CustomShopInstance);FakePc fpc = getFakePc();if(fpc !=null){
setTitle(fpc.title);}}@Overridepublicvoid onBypassFeedback(final L2PcInstance player,String command){StringTokenizer st =newStringTokenizer(command," ");String actualCommand = st.nextToken();if(player ==null){return;}if(!player.isPremium()){System.out.println("Only premium player can use this shop!");return;}if(actualCommand ==null){return;}if(actualCommand.startsWith("buy")){System.out.println("buy");}elseif(actualCommand.startsWith("sell")){System.out.println("sell");}}}
Dear friends! We are pleased to present our new Telegram bot for purchasing Telegram Stars
Convenient and easy to use
The best prices
Fast, cheap, and safe
Support for multiple payment methods
➡ Go to the bot to purchase Telegram Stars
Useful links:
Telegram bot for purchasing Telegram Stars: Go
Digital goods store: Go
Store’s Telegram bot: Go
SMM Panel: Go
Contacts and support:
➡ Telegram: https://t.me/socnet_support
➡ Telegram channel: https://t.me/accsforyou_shop
➡ WhatsApp: https://wa.me/79051904467
➡ WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n
➡ Discord: socnet_support
➡ Discord server: https://discord.gg/y9AStFFsrh
➡ ✉ Email: solomonbog@socnet.store
Through these contacts you can also:
— get consultations on wholesale purchases
— establish a partnership (current partners: https://socnet.bgng.io/partners )
— become our supplier
SocNet — digital goods and premium subscriptions store
Dear friends! We are pleased to present our new Telegram bot for purchasing Telegram Stars
Convenient and easy to use
The best prices
Fast, cheap, and safe
Support for multiple payment methods
➡ Go to the bot to purchase Telegram Stars
Useful links:
Telegram bot for purchasing Telegram Stars: Go
Digital goods store: Go
Store’s Telegram bot: Go
SMM Panel: Go
Contacts and support:
➡ Telegram: https://t.me/socnet_support
➡ Telegram channel: https://t.me/accsforyou_shop
➡ WhatsApp: https://wa.me/79051904467
➡ WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n
➡ Discord: socnet_support
➡ Discord server: https://discord.gg/y9AStFFsrh
➡ ✉ Email: solomonbog@socnet.store
Through these contacts you can also:
— get consultations on wholesale purchases
— establish a partnership (current partners: https://socnet.bgng.io/partners )
— become our supplier
SocNet — digital goods and premium subscriptions store
Question
0flee
As title say, i want to make a gm shop just for premium users. I make code like this and witout premium i still can use. I put few logs, but don't work.
P.S. I use L2j-Sunrise.
Thank you !
3 answers to this question
Recommended Posts