[Help] Login Function
#1

Hello I have a problem in the login server, I hope someone can help me.
mysql plugin I use is the blueg

after passing through the 'while' the rest of the wage functions.
pawn Код:
forward CarregarJogador(playerid);
public CarregarJogador(playerid)
{
        mysql_free_result();
        new query[200], pname[24],save[100];
        GetPlayerName(playerid, pname, 24);
        format(query, sizeof(query), "SELECT * FROM Jogadores WHERE Nome = '%s'", pname);
        mysql_query(query);
        mysql_store_result();
        while(mysql_fetch_row_format(query))
        {
            mysql_fetch_field_row(save,"RG");PlayerInfo[playerid][RG] = strval(save);
            mysql_fetch_field_row(save,"ContaV");PlayerInfo[playerid][ContaV] = strval(save);
            mysql_fetch_field_row(save,"Nome");format(PlayerInfo[playerid][Nome],50,"%s", save);
            mysql_fetch_field_row(save,"Email");format(PlayerInfo[playerid][Email],50,"%s",save);
            mysql_fetch_field_row(save,"NascimentoDia");PlayerInfo[playerid][NascimentoDia] = strval(save);
            mysql_fetch_field_row(save,"NascimentoMes");PlayerInfo[playerid][NascimentoMes] = strval(save);
            mysql_fetch_field_row(save,"NascimentoAno");PlayerInfo[playerid][NascimentoAno] = strval(save);
            mysql_fetch_field_row(save,"Sexo");PlayerInfo[playerid][Sexo] = strval(save);
            mysql_fetch_field_row(save,"NivelAdmin");PlayerInfo[playerid][NivelAdmin] = strval(save);
            mysql_fetch_field_row(save,"SkinCasual");PlayerInfo[playerid][SkinCasual] = strval(save);
            mysql_fetch_field_row(save,"SkinTrabalho");PlayerInfo[playerid][SkinTrabalho] = strval(save);
            mysql_fetch_field_row(save,"DiasVip");PlayerInfo[playerid][DiasVip] = strval(save);
            mysql_fetch_field_row(save,"NivelVip");PlayerInfo[playerid][NivelVip] = strval(save);
            mysql_fetch_field_row(save,"Celular");PlayerInfo[playerid][Celular] = strval(save);
            mysql_fetch_field_row(save,"EmailJogo");format(PlayerInfo[playerid][EmailJogo],50,"%s",save);
            mysql_fetch_field_row(save,"Organizacao");PlayerInfo[playerid][Organizacao] = strval(save);
            mysql_fetch_field_row(save,"LocalSpawn");PlayerInfo[playerid][LocalSpawn] = strval(save);
            mysql_fetch_field_row(save,"CPF");PlayerInfo[playerid][CPF] = strval(save);
            mysql_fetch_field_row(save,"Dinheiro");PlayerInfo[playerid][Dinheiro] = strval(save);
            mysql_fetch_field_row(save,"DinheiroBanco");PlayerInfo[playerid][DinheiroBanco] = strval(save);
            mysql_fetch_field_row(save,"Cash");PlayerInfo[playerid][Cash] = strval(save);
            mysql_fetch_field_row(save,"Cidade");PlayerInfo[playerid][Cidade] = strval(save);
            mysql_fetch_field_row(save,"HabilitacaoTerrestre");PlayerInfo[playerid][HabilitacaoTerrestre] = strval(save);
            mysql_fetch_field_row(save,"HabilitacaoNautica");PlayerInfo[playerid][HabilitacaoNautica] = strval(save);
            mysql_fetch_field_row(save,"HabilitacaoAerea");PlayerInfo[playerid][HabilitacaoAerea] = strval(save);
            mysql_fetch_field_row(save,"VezesHabilitacaoTerrestre");PlayerInfo[playerid][VezesHabilitacaoTerrestre] = strval(save);
            mysql_fetch_field_row(save,"VezesHabilitacaoNautica");PlayerInfo[playerid][VezesHabilitacaoNautica] = strval(save);
            mysql_fetch_field_row(save,"VezesHabilitacaoAerea");PlayerInfo[playerid][VezesHabilitacaoAerea] = strval(save);
            mysql_fetch_field_row(save,"Emprego");PlayerInfo[playerid][Emprego] = strval(save);
            mysql_fetch_field_row(save,"HorasJogadas");PlayerInfo[playerid][HorasJogadas] = strval(save);
            mysql_fetch_field_row(save,"MinutosJogados");PlayerInfo[playerid][MinutosJogados] = strval(save);
            mysql_fetch_field_row(save,"Nivel");PlayerInfo[playerid][Nivel] = strval(save);
            mysql_fetch_field_row(save,"Experiencia");PlayerInfo[playerid][Experiencia] = strval(save);
            mysql_fetch_field_row(save,"EstiloLuta");PlayerInfo[playerid][EstiloLuta] = strval(save);
            mysql_fetch_field_row(save,"SkillPistola");PlayerInfo[playerid][SkillPistola] = strval(save);
            mysql_fetch_field_row(save,"SkillSilenced");PlayerInfo[playerid][SkillSilenced] = strval(save);
            mysql_fetch_field_row(save,"SkillDesert");PlayerInfo[playerid][SkillDesert] = strval(save);
            mysql_fetch_field_row(save,"SkillShotgun");PlayerInfo[playerid][SkillShotgun] = strval(save);
            mysql_fetch_field_row(save,"SkillShotgunSerrada");PlayerInfo[playerid][SkillShotgunSerrada] = strval(save);
            mysql_fetch_field_row(save,"SkillShotgunCombate");PlayerInfo[playerid][SkillShotgunCombate] = strval(save);
            mysql_fetch_field_row(save,"SkillUzi");PlayerInfo[playerid][SkillUzi] = strval(save);
            mysql_fetch_field_row(save,"SkillMP5");PlayerInfo[playerid][SkillMP5] = strval(save);
            mysql_fetch_field_row(save,"SkillAK47");PlayerInfo[playerid][SkillAK47] = strval(save);
            mysql_fetch_field_row(save,"SkillM4");PlayerInfo[playerid][SkillM4] = strval(save);
            mysql_fetch_field_row(save,"SkillSniper");PlayerInfo[playerid][SkillSniper] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillPistola");PlayerInfo[playerid][VezesSkillPistola] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillSilenced");PlayerInfo[playerid][VezesSkillSilenced] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillDesert");PlayerInfo[playerid][VezesSkillDesert] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillShotgun");PlayerInfo[playerid][VezesSkillShotgun] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillShotgunSerrada");PlayerInfo[playerid][VezesSkillShotgunSerrada] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillShotgunCombate");PlayerInfo[playerid][VezesSkillShotgunCombate] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillUzi");PlayerInfo[playerid][VezesSkillUzi] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillMP5");PlayerInfo[playerid][VezesSkillMP5] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillAK47");PlayerInfo[playerid][VezesSkillAK47] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillM4");PlayerInfo[playerid][VezesSkillM4] = strval(save);
            mysql_fetch_field_row(save,"VezesSkillSniper");PlayerInfo[playerid][VezesSkillSniper] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeAssalto");PlayerInfo[playerid][HabilidadeAssalto] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeSequestro");PlayerInfo[playerid][HabilidadeSequestro] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeArrombamento");PlayerInfo[playerid][HabilidadeArrombamento] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeMecanico");PlayerInfo[playerid][HabilidadeMecanico] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeJornalismo");PlayerInfo[playerid][HabilidadeJornalismo] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeReporter");PlayerInfo[playerid][HabilidadeReporter] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeProstituicao");PlayerInfo[playerid][HabilidadeProstituicao] = strval(save);
            mysql_fetch_field_row(save,"HabilidadePolicial");PlayerInfo[playerid][HabilidadePolicial] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeGangster");PlayerInfo[playerid][HabilidadeGangster] = strval(save);
            mysql_fetch_field_row(save,"HabilidadeAssassino");PlayerInfo[playerid][HabilidadeAssassino] = strval(save);
            mysql_fetch_field_row(save,"VezesHabAssalto");PlayerInfo[playerid][VezesHabAssalto] = strval(save);
            mysql_fetch_field_row(save,"VezesHabSequestro");PlayerInfo[playerid][VezesHabSequestro] = strval(save);
            mysql_fetch_field_row(save,"VezesHabArrombamento");PlayerInfo[playerid][VezesHabArrombamento] = strval(save);
            mysql_fetch_field_row(save,"VezesHabMecanico");PlayerInfo[playerid][VezesHabMecanico] = strval(save);
            mysql_fetch_field_row(save,"VezesHabJornalismo");PlayerInfo[playerid][VezesHabJornalismo] = strval(save);
            mysql_fetch_field_row(save,"VezesHabReporter");PlayerInfo[playerid][VezesHabReporter] = strval(save);
            mysql_fetch_field_row(save,"VezesHabProstituicao");PlayerInfo[playerid][VezesHabProstituicao] = strval(save);
            mysql_fetch_field_row(save,"VezesHabPolicial");PlayerInfo[playerid][VezesHabPolicial] = strval(save);
            mysql_fetch_field_row(save,"VezesHabGangster");PlayerInfo[playerid][VezesHabGangster] = strval(save);
            mysql_fetch_field_row(save,"VezesHabAssassino");PlayerInfo[playerid][VezesHabAssassino] = strval(save);
            mysql_fetch_field_row(save,"Matou");PlayerInfo[playerid][Matou] = strval(save);
            mysql_fetch_field_row(save,"Morreu");PlayerInfo[playerid][Morreu] = strval(save);
            mysql_fetch_field_row(save,"Preso");PlayerInfo[playerid][Preso] = strval(save);
            mysql_fetch_field_row(save,"TempoPreso");PlayerInfo[playerid][TempoPreso] = strval(save);
            mysql_fetch_field_row(save,"Cocaina");PlayerInfo[playerid][Cocaina] = strval(save);
            mysql_fetch_field_row(save,"Maconha");PlayerInfo[playerid][Maconha] = strval(save);
            mysql_fetch_field_row(save,"Crack");PlayerInfo[playerid][Crack] = strval(save);
            mysql_fetch_field_row(save,"Oxi");PlayerInfo[playerid][Oxi] = strval(save);
            mysql_fetch_field_row(save,"Procurado");PlayerInfo[playerid][Procurado] = strval(save);
            mysql_fetch_field_row(save,"Gang");PlayerInfo[playerid][Gang] = strval(save);
            mysql_fetch_field_row(save,"LocalSpawnX");PlayerInfo[playerid][LocalSpawnX] = floatstr(save);
            mysql_fetch_field_row(save,"LocalSpawnY");PlayerInfo[playerid][LocalSpawnY] = floatstr(save);
            mysql_fetch_field_row(save,"LocalSpawnZ");PlayerInfo[playerid][LocalSpawnZ] = floatstr(save);
            mysql_fetch_field_row(save,"LocalSpawnR");PlayerInfo[playerid][LocalSpawnR] = floatstr(save);
            mysql_fetch_field_row(save,"Veiculos");PlayerInfo[playerid][Veiculos] = strval(save);
            mysql_fetch_field_row(save,"Casas");PlayerInfo[playerid][Casas] = strval(save);
            mysql_fetch_field_row(save,"IP");format(PlayerInfo[playerid][IP],50,"%s",save);
        }
        //the functions below does not work anymore
        mysql_free_result();
        logado[playerid] = true;
        SpawnPlayer(playerid);
        StopAudioStreamForPlayer(playerid);
        printf("Jogador %d- %s Logou, %s",PlayerInfo[playerid][RG],pname,PlayerInfo[playerid][Email]);
        return 1;
}
sorry for my english, I'm not very good
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)