UNTESTED
/*
* 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 2, 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* [url]http://www.gnu.org/copyleft/gpl.html[/url]
*/
package net.sf.l2j.gameserver.handler.admincommandhandlers;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import com.mysql.jdbc.Connection;
import net.sf.l2j.L2DatabaseFactory;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
public class AdminOlympiad implements IAdminCommandHandler {
private static final String[] ADMIN_COMMANDS = {"admin_addolypoint"};
public boolean useAdminCommand(String command, L2PcInstance activeChar) {
if (command.startsWith("admin_addolypoint"))
{
Connection Con = null;
try
{
Con = (Connection) L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement;
statement = Con.prepareStatement("INSERT INTO olympiad_nobles (olympiad_points) VALUES (?)");
String Val = command.substring(18);
int PoVal = Integer.parseInt(Val);
statement.setInt(1, PoVal);
statement.execute();
statement.close();
}
catch (Exception e)
{
//System.out.print("//");
}
finally
{
try
{
if (Con != null)
Con.close();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
return true;
}
public String[] getAdminCommandList()
{
return ADMIN_COMMANDS;
}
}
Created for c6
Idk if it work, try to make relogin if dont get points! maby must relog to update char stats