Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

Comando para dar permisos admin

Iniciado por Swarlog, Jun 25, 2025, 09:49 PM

Tema anterior - Siguiente tema

Swarlog

Hay poquito que decir, la cosa es que al utilizar este comando te conviertes en admin. Con ello podemos hacer que un usuarios pueda tener un rango u otro, dependendiendo de los permisos que pongamos en el comando o siemplemente algun requisitos para que solo puedan hacerlo aquellos que querramos. Es solo una base..

/*
 * 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 handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

/**
 * User Command (administrador)
 * @author swarlog
 */

public class Administrador implements IVoicedCommandHandler
{
	private static final String[] _voicedCommands =
	{
		"administrador"
	};
	
	@Override
	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
	{
		if (command.equalsIgnoreCase("administrador"))
		{
			if (activeChar == null)
			{
				return false;
			}
			
			activeChar.setAccountAccesslevel(1);
			activeChar.setAccessLevel(127);
		}
		
		return false;
	}
	
	@Override
	public String[] getVoicedCommandList()
	{
		return _voicedCommands;
	}
}