Dialog:MDCVehicle(playerid, response, listitem, inputtext[]) { if (GetFactionType(playerid) != FACTION_POLICE || !IsACruiser(GetPlayerVehicleID(playerid))) return 0; if(response) { new plate[64]; new string[152]; if(sscanf(inputtext, "s[64]", plate)) return Dialog_Show(playerid, MDCVehicle, DIALOG_STYLE_INPUT, "Mobile Data Computer - Procura de Placa", "PROCURA DE PLACA\n\nInsira a informaзгo da placa:", "Prosseguir", "Cancelar"); new Query[150]; mysql_format(g_iHandle, Query, sizeof(Query), "SELECT `character` FROM `characters` WHERE `ID` = (SELECT `carOwner` FROM cars WHERE carPlaca='%s' LIMIT 1)", plate); new Cache:handle = mysql_query(g_iHandle, Query); if(cache_get_row_count(g_iHandle)){ new user[25]; cache_get_field_content(0, "character", user, g_iHandle); cache_delete(handle, g_iHandle); format(string, sizeof(string), "RESULTADO DE BUSCA\n\nPlaca do Veнculo: %s\nModelo do Veнculo: %s\nDono do Veнculo: %s", plate,"", user); Dialog_Show(playerid, MDCResult, DIALOG_STYLE_MSGBOX, "Procurar Placa", string, "Cancelar", ""); } else{ SendErrorMessage(playerid, "PLACA NГO ENCONTRADA!"); } } return 1; }
Dialog:MDCVehicle(playerid, response, listitem, inputtext[]) { if (GetFactionType(playerid) != FACTION_POLICE || !IsACruiser(GetPlayerVehicleID(playerid))) return 0; if(response) { new plate[64]; new string[152]; if(sscanf(inputtext, "s[64]", plate)) return Dialog_Show(playerid, MDCVehicle, DIALOG_STYLE_INPUT, "Mobile Data Computer - Procura de Placa", "PROCURA DE PLACA\n\nInsira a informaзгo da placa:", "Prosseguir", "Cancelar"); new Query[150]; mysql_format(g_iHandle, Query, sizeof(Query), "SELECT `character` AND `carModel` FROM `characters` WHERE `ID` = (SELECT `carOwner` FROM cars WHERE carPlaca='%s' LIMIT 1)", plate); new Cache:handle = mysql_query(g_iHandle, Query); if(cache_get_row_count(g_iHandle)){ new user[25], cmodel[30]; cache_get_field_content(0, "character", user, g_iHandle); cache_get_field_content(0, "carModel", cmodel, g_iHandle); cache_delete(handle, g_iHandle); format(string, sizeof(string), "RESULTADO DE BUSCA\n\nPlaca do Veнculo: %s\nModelo do Veнculo: %s\nDono do Veнculo: %s", plate,"", cmodel, user); Dialog_Show(playerid, MDCResult, DIALOG_STYLE_MSGBOX, "Procurar Placa", string, "Cancelar", ""); } else{ SendErrorMessage(playerid, "PLACA NГO ENCONTRADA!"); } } return 1; }
Caso persista, tente contar os rows com outra funзгo cache:
Substitua cache_get_row_count(g_iHandle) por cache_num_rows() |
Originally Posted by a_mysql
#define cache_num_rows cache_get_row_count
|
Dialog:MDCVehicle(playerid, response, listitem, inputtext[])
{
if (GetFactionType(playerid) != FACTION_POLICE || !IsACruiser(GetPlayerVehicleID(playerid)))
return 0;
if(response)
{
new plate[64];
new string[152];
if(sscanf(inputtext, "s[64]", plate)) return Dialog_Show(playerid, MDCVehicle, DIALOG_STYLE_INPUT, "Mobile Data Computer - Procura de Placa", "PROCURA DE PLACA\n\nInsira a informaзгo da placa:", "Prosseguir", "Cancelar");
new Query[150];
mysql_format(g_iHandle, Query, sizeof(Query), "SELECT `character`, `carModel` FROM `characters`, `cars` WHERE `ID` = (SELECT `carOwner` FROM cars WHERE carPlaca='%s' LIMIT 1)", plate);
new Cache:handle = mysql_query(g_iHandle, Query);
if(cache_get_row_count(g_iHandle)){
new user[25], model[25];
cache_get_field_content(0, "character", user, g_iHandle);
cache_get_field_content(0, "carMOdel", model, g_iHandle);
cache_delete(handle, g_iHandle);
format(string, sizeof(string), "RESULTADO DE BUSCA\n\nPlaca do Veнculo: %s\nModelo do Veнculo: %s\nDono do Veнculo: %s", plate,model, user);
Dialog_Show(playerid, MDCResult, DIALOG_STYLE_MSGBOX, "Procurar Placa", string, "Cancelar", "");
} else{
SendErrorMessage(playerid, "PLACA NГO ENCONTRADA!");
}
}
return 1;
}
(facepalm)
PHP код:
-Vai skype |