Jump to content

Recommended Posts

Posted
13 hours ago, Nightw0lf said:

http://prntscr.com/j77h2z

this is how you start this will open a window.

you register also the voiced command on the voiced handler, this is an example of what you ask the rest is up to the brain.

i think you understand me wrong mate , because i think my english is little bad .... i want to make an command for example ( .gatekeeper ) and when i use that command in chat i want to open gatekeper html just that only 

Posted
17 minutes ago, Prostyle1990 said:

i think you understand me wrong mate , because i think my english is little bad .... i want to make an command for example ( .gatekeeper ) and when i use that command in chat i want to open gatekeper html just that only 

the answer is in nightw0lf's link. try to understand what you have to change.

 

Btw, learn some basics before you continue...

Posted

i am not sure if is working but i think that you need i make you a code open html .gatekeeper can use more chat like .pageGk and can teleport and stay in same page with .tele like .tele pageId and teleId from teleports.xml list

 

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.PcInstance;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.model.zone.ZoneId;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeperCmd implements IVoicedCommandHandler
{
	private static final String[] VOICED_COMMANDS =
	{
		"gatekeeper",
		"PageGk",
		"tele"
	};
	
	@Override
	public boolean useVoicedCommand(final String command, final PcInstance activeChar, final String target)
	{
		final StringTokenizer st = new StringTokenizer(command, " ");
		int page = 0;
		int locId = 0;
		if (command.startsWith("gatekeeper"))
		{
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("PageGk"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
			}
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("tele"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
				locId = Integer.parseInt(st.nextToken());
			}
			final TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(locId);
			Teleport(activeChar, page, list);
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
	
	public boolean mainHtm(final PcInstance activeChar, int page)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		else if (!activeChar.isInsideZone(ZoneId.TOWN) || !activeChar.isInsideZone(ZoneId.PEACE))
		{
			activeChar.sendMessage("You can't use this command out of town or peace zone.");
			return false;
		}
		else
		{
			NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
			activeChar.sendPacket(html);
			return true;
		}
	}
	
	public boolean Teleport(final PcInstance activeChar, int page, TeleportLocation list)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
		activeChar.teleToLocation(list, 20);
		activeChar.sendPacket(html);
		return true;
		
	}
}

 

Posted
9 hours ago, tazerman2 said:

i am not sure if is working but i think that you need i make you a code open html .gatekeeper can use more chat like .pageGk and can teleport and stay in same page with .tele like .tele pageId and teleId from teleports.xml list

 


/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.PcInstance;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.model.zone.ZoneId;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeperCmd implements IVoicedCommandHandler
{
	private static final String[] VOICED_COMMANDS =
	{
		"gatekeeper",
		"PageGk",
		"tele"
	};
	
	@Override
	public boolean useVoicedCommand(final String command, final PcInstance activeChar, final String target)
	{
		final StringTokenizer st = new StringTokenizer(command, " ");
		int page = 0;
		int locId = 0;
		if (command.startsWith("gatekeeper"))
		{
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("PageGk"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
			}
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("tele"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
				locId = Integer.parseInt(st.nextToken());
			}
			final TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(locId);
			Teleport(activeChar, page, list);
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
	
	public boolean mainHtm(final PcInstance activeChar, int page)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		else if (!activeChar.isInsideZone(ZoneId.TOWN) || !activeChar.isInsideZone(ZoneId.PEACE))
		{
			activeChar.sendMessage("You can't use this command out of town or peace zone.");
			return false;
		}
		else
		{
			NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
			activeChar.sendPacket(html);
			return true;
		}
	}
	
	public boolean Teleport(final PcInstance activeChar, int page, TeleportLocation list)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
		activeChar.teleToLocation(list, 20);
		activeChar.sendPacket(html);
		return true;
		
	}
}

 

you just helped him to raise to many questions that he dont even know how to ask he has to start from the basics good luck on that complex way to start

Posted
On 4/19/2018 at 11:16 PM, tazerman2 said:

i am not sure if is working but i think that you need i make you a code open html .gatekeeper can use more chat like .pageGk and can teleport and stay in same page with .tele like .tele pageId and teleId from teleports.xml list

 


/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.PcInstance;
import net.sf.l2j.gameserver.model.location.TeleportLocation;
import net.sf.l2j.gameserver.model.zone.ZoneId;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeperCmd implements IVoicedCommandHandler
{
	private static final String[] VOICED_COMMANDS =
	{
		"gatekeeper",
		"PageGk",
		"tele"
	};
	
	@Override
	public boolean useVoicedCommand(final String command, final PcInstance activeChar, final String target)
	{
		final StringTokenizer st = new StringTokenizer(command, " ");
		int page = 0;
		int locId = 0;
		if (command.startsWith("gatekeeper"))
		{
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("PageGk"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
			}
			mainHtm(activeChar, page);
		}
		else if (command.startsWith("tele"))
		{
			if (st.hasMoreTokens())
			{
				page = Integer.parseInt(st.nextToken());
				locId = Integer.parseInt(st.nextToken());
			}
			final TeleportLocation list = TeleportLocationData.getInstance().getTeleportLocation(locId);
			Teleport(activeChar, page, list);
		}
		return true;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
	
	public boolean mainHtm(final PcInstance activeChar, int page)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		else if (!activeChar.isInsideZone(ZoneId.TOWN) || !activeChar.isInsideZone(ZoneId.PEACE))
		{
			activeChar.sendMessage("You can't use this command out of town or peace zone.");
			return false;
		}
		else
		{
			NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
			activeChar.sendPacket(html);
			return true;
		}
	}
	
	public boolean Teleport(final PcInstance activeChar, int page, TeleportLocation list)
	{
		if (activeChar == null)
		{
			return false;
		}
		
		NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile("data/html/gatekeeper/customTele" + (page == 0 ? "" : "-" + page) + ".htm");
		activeChar.teleToLocation(list, 20);
		activeChar.sendPacket(html);
		return true;
		
	}
}

 

man thank you for you answer , but i already lost 1 week without any succes :( maybe can you make for me just an command like .gatekeeper and when i press .gatekeeper i want to open _bbsgatekeper html page please ? i want to use that commmand in l2mythras file witch is shared here on mxc please 

Posted
2 hours ago, SweeTs said:

I don't get it. Why would I use .gatekeeper rather than pressing directly ALT+G? I wonder.

alt + g + 1 click = 2 buttons 1 click
tele = 4 buttons
true why?????? well maybe is some old server with default cb xD somebody opens official server again!

Posted

Maybe you mean Alt + B to send Board package?
Alt + G is Admin package...

Also i'm sure that this command will be not his only problem if he run server with this knowledge.

Posted
1 hour ago, Tony360 said:

Maybe you mean Alt + B to send Board package?
Alt + G is Admin package...

Also i'm sure that this command will be not his only problem if he run server with this knowledge.

You have right alt+g its only for admin  ! now i will explain why i want to make this commands , just because i adapted this shortcuts to my interface and when i press each button just appear in chat .buffer .gatekeeper .shop etc....because commands are not implemented in java :D to open the html page for each button 

 

 

here is the pic ---------> https://ibb.co/gBW1rx <--------------

Posted
7 hours ago, Tony360 said:

Maybe you mean Alt + B to send Board package?
Alt + G is Admin package...

Also i'm sure that this command will be not his only problem if he run server with this knowledge.

yes alt+b oh i did not know alt + g is "admin package" can you tell us more about it? what it does?

 

6 hours ago, Prostyle1990 said:

You have right alt+g its only for admin  ! now i will explain why i want to make this commands , just because i adapted this shortcuts to my interface and when i press each button just appear in chat .buffer .gatekeeper .shop etc....because commands are not implemented in java :D to open the html page for each button 

 

 

here is the pic ---------> https://ibb.co/gBW1rx <--------------

but you have the code and i gave you an example you have the tools you have the materials USE them now its like having a naked lady in your bed and asking the crowd how to fuck her. ffs.

Posted
2 hours ago, Nightw0lf said:

yes alt+b oh i did not know alt + g is "admin package" can you tell us more about it? what it does?

 

Dude he said something about community and I though you and SweeTs mistakly said “G”and not “B” stop be toxic.

Posted

guys what i want to do its only to create a command for my buttons when i press button gatekeper to open "bypass _bbsgatekeeper" page but right now when i press button with gatekeper only appear in chat .gatekeeper because i have no voicedcommands maybe someone can make for me an example ? files what i use its shared here L2Mythras file  https://ibb.co/gBW1rx 

Posted

well finally i did this working for me but now i have another problem for example when i type .gk open me gatekeeper page but not in corectly dimension and open in dialog dimension that mean my original gatekeper html page its 780x512 and when i press .gk it open in 289x359 how i can fix that ?any can help ?

Posted (edited)

guys my code look like that but i dont know why in game when i use .gatekeeper appear me gk page but in a small window and not on original window maybe someone can help me please ???? 

 

 


 

package l2f.gameserver.handler.voicecommands.impl;

import l2f.gameserver.handler.voicecommands.IVoicedCommandHandler;
import l2f.gameserver.model.Player;
import l2f.gameserver.network.serverpackets.NpcHtmlMessage;

public class gatekeeper implements IVoicedCommandHandler
{

    @Override
    public boolean useVoicedCommand(String command, Player activeChar, String target)
    {
        if (!target.isEmpty())
        {


        }
        showMainPage(activeChar);
        return true;
    }


    private static void showMainPage(Player activeChar)
    {
        activeChar.sendPacket(new NpcHtmlMessage(0).setFile("scripts/services/communityPVP/gatekeeper/main.htm"));
    }

    @Override
    public String[] getVoicedCommandList()
    {
        return new String[]
        {
            "gatekeeper"
        };
    }

}


 

Edited by Prostyle1990

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • 🔥 HF Rework Multi-Proff x10 is coming! ⚔️ New Samurai Crow Client ⚔️ Reworked Systems & Progression ⚔️ Updated Instances ⚔️ Classic Multeria Atmosphere 🧪 Pre-OBT is already live! 📅 Official OBT: June 29 🚀 Launch: July 3 🐞 Report bugs during testing and earn valuable rewards at launch! See you on the battlefield! https://rework.multeria.world/
    • PlayCMS - это удобная система управления веб-сайтом, разработанная специально для игровых проектов Lineage 2. CMS позволяет быстро запустить полнофункциональный серверный сайт с регистрацией игроков, личным кабинетом, новостями, рейтингами, магазином, модулями и гибкой панелью администратора. Система ориентирована на владельцев серверов Lineage 2, которым нужен красивый, функциональный и понятный сайт без лишних сложностей.  PlayCMS уже предоставляет базовые функции для управления проектами, такие как публикация новостей, настройка страниц, работа с пользователями, подключение шаблонов, а также установка модулей и плагинов. Ключевые особенности PlayCMS: — удобная административная панель; — регистрация и авторизация игроков; — учетная запись пользователя; — новостные и информационные страницы; — рейтинги игроков и кланов; — поддержка шаблонов дизайна; — установка модулей и плагинов через административную панель; — магазин цифровых продуктов; — категории продуктов; — возможность добавить фавикон; — защита лицензии для административной панели; — адаптация для игровых проектов Lineage 2; — возможность расширения функционала в соответствии с потребностями сервера. PlayCMS подходит как для новых игровых проектов, так и для существующих серверов, которым нужен удобный сайт с современным дизайном и интуитивно понятным управлением. Система проста в настройке и поддерживает индивидуальные шаблоны, дополнительные плагины и модули, что позволяет вам развивать свой сайт параллельно с развитием сервера. PlayCMS — это готовое решение для владельцев серверов Lineage 2, которым нужен красивый, быстрый и функциональный сайт. Демоверсия —  https://demo.playcms.ru/ Я разработчик этого чуда. Я готов выслушать конструктивную критику, а также ваши предложения по улучшению движка. Кроме того, я пишу модули любой сложности для этой CMS. Свяжитесь со мной: Telegram — @playcms       EN   PlayCMS is a user-friendly website management system designed specifically for Lineage 2 gaming projects. The CMS allows you to quickly launch a fully functional server website with player registration, personal account, news, ratings, a store, modules, and a flexible admin panel. The system is focused on Lineage 2 server owners who need a beautiful, functional, and clear website without unnecessary complexity. PlayCMS already provides basic features for project management, such as publishing news, customizing pages, working with users, connecting templates, and installing modules and plugins. Key Features of PlayCMS: — a convenient administrative panel; — player registration and authorization; — user account; — news and information pages; — player and clan ratings; — support for design templates; — installation of modules and plugins through the admin panel; — digital product store; — product categories; — ability to add a favicon; — license protection for the admin panel; — adaptation for Lineage 2 game projects; — the ability to expand functionality to meet the needs of the server. PlayCMS is suitable for both new gaming projects and existing servers that require a user-friendly website with a modern appearance and intuitive management. The system is easy to configure and supports individual templates, additional plugins, and modules, allowing you to develop your website alongside your server. PlayCMS is a ready-made solution for Lineage 2 server owners who need a beautiful, fast, and functional website. Demo - https://demo.playcms.ru/ I am the developer of this miracle. I am ready to listen to constructive criticism, as well as your suggestions for improving the engine. I also write modules of any complexity for this cms. Contact me: Telegram - @playcms   Скачать\Download : https://drive.google.com/file/d/15Az9WVDD4SQNyOPAsXMU4-mGHOiA_U_d/view     Added a new module "Wheel of Fortune" to the demo version.  PlayCMS Fortune Wheel - module "Wheel of Fortune" for Play CMS Purpose: - adds a Lineage 2-style wheel of fortune to the user's personal account; - displays in the personal account on top of the balance and warehouse block; - supports prizes: Adena, Coin of Luck, premium account, common items, empty slots; - before submitting the form, shows the animation of the wheel spinning; - if there are no attempts, it displays the "No attempts" modal window; - the won gift is automatically added to the user's inventory; - adds a separate "Wheel of Fortune" section to the admin panel; - in the admin panel, you can edit slots, Item ID, quantity, drop chance, attempts, and the price of purchasing attempts using your balance.
    • To increase visibility and make sure your offer reaches the right audience, I'd recommend exploring the tools at CS2WH. They have a Deals Bot that might help you track market prices and adjust your strategy on the fly. I'm finding their resources super helpful for keeping tabs on the trading scene. Plus, they emphasize safety and provide insights on legal skin trading, which is crucial for maintaining credibility.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..