- Регистрация
- 3 Июл 2018
- Сообщения
- 190
- Лучшие ответы
- 1
- Репутация
- 12
Здравствуйте, в любом случае пишет что "У вас нет автомобилей!" хотя они есть и не один.
HTML:
CMD:fixcar(playerid)
{
if(!pInfo[playerid][pHouse]) return SendClientMessage(playerid, COLOR_GREY, "Вы не владеете домом!");
new vehid = pTemp[playerid][pCarPlayerID],string[256];
if(vehid != INVALID_PLAYER_ID)
{
format(string,sizeof(string),"У Вас уже есть полученный автомобиль '%s'\nВы желаете эвакуировать его в гараж и получить другой
автомобиль?",VehStats[CarsInfo[vehid][cModel]-400][vName]);
ShowPlayerDialog(playerid, dFixCar+1, DIALOG_STYLE_LIST, "Автопарк", string, "Да", "Нет");
return true;
}
new str[64],Cache:result,rows;
mysql_format(dbHandle, string, sizeof(string), "SELECT `cID`,`cModel` FROM `"T_CARS"` WHERE `cOwner` = '%e'", GetName(playerid));
result = mysql_query(dbHandle, string);
cache_get_row_count(rows);
if(rows)
{
new cid,model;
for(new i = -1; ++i < rows;)
{
cache_get_value_index_int(i, 0, cid);
cache_get_value_index_int(i, 1, model);
Fix_Cars[playerid][i] = cid;
format(str,sizeof(str),"[%d|%d] - %s(%d)\n",i+1,Fix_Cars[playerid][i],VehStats[model-400][vName],model);
strcat(string,str);
}
ShowPlayerDialog(playerid, dFixCar, DIALOG_STYLE_LIST, "Автопарк", string, "Выбрать", "Закрыть");
SendClientMessage(playerid,-1,"Выберите автомобиль,который хотите получить!");
}
else SendClientMessage(playerid, COLOR_GREY, "У Вас нет автомобилей!");
cache_delete(result);
return 1;
}