/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>

#define FLAGA ADMIN_BAN

public plugin_init() {
	register_plugin("Przenoszenie LVL", "1.0", "byQQ");
	
	register_concmd("cod_przenies", "handle_przenies");
	
	register_clcmd("lista_klas", "lista");
}

public handle_przenies(id)
{
	if(get_user_flags(id) & FLAGA)
	{
		new arg[3][33];
		new ids[2];
		
		read_argv(1, arg[0], 32);  // Nick
		read_argv(2, arg[1], 10);  // ID 1
		read_argv(3, arg[2], 10);  // ID 2
		
		new player = find_player("ablj", arg[0]);
		
		if(!player) return PLUGIN_CONTINUE;
				
		ids[0] = str_to_num(arg[1]);
		ids[1] = str_to_num(arg[2]);
				
		new nick[2][33], klasa[2][33];
		get_user_name(id, nick[0], 32);
		get_user_name(player, nick[1], 32);
		
		cod_get_class_name(ids[0], klasa[0], 32);
		cod_get_class_name(ids[1], klasa[1], 32);
		
		cod_set_user_class(player, ids[0], 1);
		new temp = cod_get_user_xp(player);
		cod_set_user_xp(player, 0);
		cod_set_user_class(player, ids[1], 1);
		cod_set_user_xp(player, temp);
		
		client_print(0, print_chat, "Admin %s przeniosl exp %s z %s na %s", nick[0], nick[1], klasa[0], klasa[1]);
	}
	return PLUGIN_CONTINUE;
	
}

public lista(id)
{
	client_print(id, print_console, "===============================================");
	
	for(new i = 0; i < cod_get_classes_num(); i++)
	{
		new klasa[33]; cod_get_class_name(i, klasa, 32);
		client_print(id, print_console, "ID: %d | Nazwa: %s", i, klasa);
	}
	
	client_print(id, print_console, "===============================================");	
}
