[Ajuda] Pegar id na tabela veiculos mysql
#5

Quote:
Originally Posted by iSmirnoff
Посмотреть сообщение
Seria isso

pawn Код:
forward getID(playerid); // Topo

/* Seu Comando de Checar ID */
new idVeh = GetPlayerVehicleID(playerid), queryMySQL[70];
GetVehicle(idVeh, ColorOne, ColorTwo);
format(queryMySQL, 70, "SELECT * FROM vehicles WHERE id='%i'", Vehicleinfo[id]);
mysql_function_query(Conexao, queryMySQL, true, "getID", "i", playerid);

/* Callback de Checar ID */
public getID(playerid) {
    new Rows, Field;
    cache_get_data(Rows, Field, Conexao);
    if(Row > 0) {
        new idVeh, res[30], string[10];
        cache_get_field_content(0, "id", res, Conexao), idVeh = strval(str);
        format(string, 10, "ID: %i");
        SendClientMessage(playerid, 1, string);
    }
    return true;
}
Nгo testei, caso tenha algum erro no compilador poste aqui.
Quote:
Originally Posted by iCasTiel
Посмотреть сообщение
Nгo entendi o propуsito disso, no exemplo abaixo fiz uma consulta para pegar o modelo.

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleColor(vehicleid, ColorOne, ColorTwo);
format(Query, sizeof(Query), "SELECT * FROM vehicles WHERE id = '%i'", VehicleInfo[id]);
mysql_function_query(Conexao, Query, true, "getVehicleInformation", "d", playerid);



forward getVehicleInformation(playerid);
public getVehicleInformation(playerid) {

    new linhas_c, colunas_c;
    cache_get_data(linhas_c, colunas_c, Conexao);

    if (linhas_c == 0 )
        SendClientMessage(playerid, -1, "Nenhum resultado encontrado!");
    else {
        new result[25], model;
        cache_get_field_content(0, "model", result, Conexao);
        model = strval(result);
        format (str, 25, "Modelo й %d", id);
        SendClientMessage(playerid, -1, str);
    }
    return 1;
}
A formataзгo da Query fica com vocк!
Nгo funcionou
Reply


Messages In This Thread
Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 02:25
Re: Pegar id na tabela veiculos mysql - by Gii - 12.01.2014, 02:36
Re: Pegar id na tabela veiculos mysql - by smiiir - 12.01.2014, 12:21
Re: Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 13:59
Re: Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 14:33
Re: Pegar id na tabela veiculos mysql - by Alexbav - 12.01.2014, 23:41
Re: Pegar id na tabela veiculos mysql - by Kmatsu - 13.01.2014, 00:05
Re: Pegar id na tabela veiculos mysql - by Alexbav - 13.01.2014, 00:08
Re: Pegar id na tabela veiculos mysql - by Kmatsu - 13.01.2014, 00:33
Re: Pegar id na tabela veiculos mysql - by Alexbav - 13.01.2014, 00:35

Forum Jump:


Users browsing this thread: 1 Guest(s)