
public logevent_game()
{
	if(get_pcvar_num(cvar_bleach) != 1 || !get_playersnum()) return PLUGIN_CONTINUE;
	
	static log_action[32];
	read_logargv(1,log_action,64);
	
	if(equal(log_action,"Round_End"))
	{
		g_event_round_end=true;
		
		buy_time_over();
		
		new players[MAXPLAYERS],id;
		static num;
		
		get_players(players,num,"ch");

		for(new i = 0; i < num; i++)
		{
			id=players[i];
	
			g_player_first_spawn[id]=false;
			g_player_class_selected[id]=false;
			g_player_skill_reseted[id]=false;
			g_player_character_reseted[id]=false;
			g_player_negation_used[id]=false;
			
			save_player(id);
		}
	}
	else if(equal(log_action,"Round_Start"))
	{
		g_player_bomber=0;
		g_player_planter=0;
		g_player_defuser=0;
		g_event_planted=false;
		g_event_freeze_time=false;
		item_drop_remove();
	}
	else if (containi(log_action,"Restart_Round_") != -1)
	{
		g_event_round_end=true;
		
		buy_time_over();
		reset_player_all();
	}
	
	return PLUGIN_CONTINUE;
}

public logevent_player()
{
	if(get_pcvar_num(cvar_bleach) != 1 || !get_playersnum()) return PLUGIN_CONTINUE;
	
	static log_arg[64],log_action[64];
	new player_name[32],id;

	read_logargv(0,log_arg,63);
	read_logargv(2,log_action,63);
	parse_loguser(log_arg,player_name,31,id);

	id = get_user_index(player_name);
	
	if(!is_user_connected(id) || id == 0) 
	{
		return PLUGIN_CONTINUE;
	}
	
	if(equal(log_action,"Spawned_With_The_Bomb") || equal(log_action,"Got_The_Bomb"))
	{
		if(!g_player_first_spawn[id])
		{
			static xp;
			xp=xp_get(get_pcvar_num(cvar_xp_bomber));
			
			client_print(id,print_chat,"%L",id,"L_XP_SPAWN_BOMB",PLUGIN_TAG,xp);
			xp_set(id,g_player_experience[id]+xp);
		}
		g_player_bomber=id;
	}
	else if(equal(log_action,"Dropped_The_Bomb"))
	{
		if(!g_player_first_spawn[id])
		{
			static xp;
			xp=xp_get(get_pcvar_num(cvar_xp_bomber));
			
			client_print(id,print_chat,"%L",id,"L_XP_DROP_BOMB",PLUGIN_TAG,xp);
			xp_set(id,g_player_experience[id]-xp);
		}
		g_player_bomber=0;
	}
	
	return PLUGIN_CONTINUE;
}

public logevent_objective_team()
{
	if(get_pcvar_num(cvar_bleach) != 1 || !get_playersnum()) return PLUGIN_CONTINUE;
	
	static log_team[32],log_action[64];

	read_logargv(1,log_team,31);
	read_logargv(3,log_action,63);
	
	if(equal(log_action,"CTs_Win" ))
	{
		set_task(2.0,"xp_win_round",TEAM_CT);
	}
	else if(equal(log_action,"Terrorists_Win"))
	{
		set_task(2.0,"xp_win_round",TEAM_T);
	}
	
	return PLUGIN_CONTINUE;
}
