Проверьте имя в БД перед вставкой новой записи
$data = array(
"id_username" => $this->session->id_account,
"name_character" => $nome,
"birthdate" => $data,
"origin" => $origem,
"gender" => $sexo,
"pergunta1" => $pergunta3,
"pergunta2" => $pergunta4,
"history" => $history
);
$if_exists = $this->usuarios_model->check_user($data['name_character']);
//Here apply condition to check if user is exists or not
if($if_exists > 0){
//Already Exists
}else{
$this->usuarios_model->criarPersonagem($data); //New registration
}
Модель
public function check_user($name_character){
//Here, get the number if rows with the new user name
return $this->db->get_where('characters', ['Character' => $name_character])->num_rows();
}