Зарегистрировавшись у нас, вы сможете обсуждать, делиться и отправлять личные сообщения другим участникам нашего сообщества.
Зарегистрироваться!cmd:cars(playerid)
{
format(global_str, 128, "SELECT * FROM ownable WHERE BINARY Owner = '%s'", PN(playerid));
new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid;
count = cache_get_row_count(mysql);
if !count *then
return SCMF(playerid, COLOR_S_1, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid));
if GetPlayerLauncher(playerid) == 1 *then
{
if(ShowVeh[playerid] != -1)
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleInfoList', '[ null ]');"),
executeEvent(playerid, 0, "window.executeEvent('cef.modals.closeModal', `[\"carMenu\"]`);");
executeEvent(playerid, 0, "window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);");
}
global_str = "";
for new idx, numberData[4][10]; idx < count; idx++ do
{
if cache_get_row_int(idx, 40, mysql) != -1 *then
continue;
ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql);
carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid );
if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then
sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData);
if GetPlayerLauncher(playerid) == 1 *then
{
if(carid)
f(mysql_string, sizeof(mysql_string), "{\"title\":\"%s\",\"icon\":\"icon-car-number\"},{\"title\":\"%s\",\"icon\":\"icon-fuel\"},", GetString(CarInfo[sqlid][cNumber], "Arizona ST") ? "Нет" : (str_f("[%s] %s (%s)", numberData[1], numberData[0], countryNumber[strval(numberData[3])])), !GetVehicleKindFuel(carid) ? "ДВЗ" : "Топливо");
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\
{\"id\":\"%i\",\"title\":\"%s\",\"sysName\":\"%i.png\",\"status\":\"%s\",\"labels\":[\
%s{\"title\":\"%s\",\"icon\":\"icon-id\"}]\
}]\
`);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? mysql_string : "", carid ? (str_f("%i", carid)) : "Не загружена")));
}
else
{
if !carid *then
format(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 33, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n");
else if CarInfo[sqlid][cShtraf] *then
format(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid);
else
{
switch VehicleInfo[carid][vModification] do
{
case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}";
case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}";
case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}";
case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}";
default: mysql_string = "";
}
format(global_str, 1024, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n");
}
}
}
if GetPlayerLauncher(playerid) == 1 *then
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count))),
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid)))),
cursorPlayer(playerid, 0, true);
return cache_delete(result, mysql), SPD(playerid, 162, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена");
}
case 162:
{
if(!response) return false;
new carid = OnPlayerCarLoad(ShowCar[playerid][listitem][0]), number = GetVehicleID(carid), Cache:result;
if(!carid)
{
format(SQL_STRING, 128, "SELECT Model, ConnectLoad FROM ownable WHERE ID = %d LIMIT 1;", ShowCar[playerid][listitem][0]);
result = mysql_query(mysql, SQL_STRING);
}
ShowVeh[playerid] = (!carid ? ShowCar[playerid][listitem][0] : carid);
format(mysql_string, 50, "Инструменты для %s%s", GetVehicleName((!carid ? cache_get_row_int(0, 0, mysql) : GetVehicleModelEx(carid)), true), !carid ? "" : (str_f(" (%i)", carid)));
strcat(global_str, (str_f("%s\n%s", !carid ? "Загрузить машину" : (CarInfo[number][cLock] ? "{FF6347}Открыть" : "{9ACD32}Закрыть"), !carid ? (cache_get_row_int(0, 1, mysql) ? "Не загружать при авторизации" : "Загружать при авторизации") : (CarInfo[number][cKeyIN] ? "{9ACD32}Вытащить ключи" : "{FF6347}Вставить ключи"))));
if(carid && IsPlayerHaveCar(playerid, carid))
f(global_str, sizeof(global_str), \
"%s\nПрипарковать\nНайти\n%s\n{73B461}Информация о авто (Паспорт)\n%s\n{FFFFFF}Режим езды [ %s{FFFFFF} ]\nСистема ABS [ {FD4D3D}Отсутствует{FFFFFF} ]\n{FFFFFF}Заспавнить машину [ {9ACD32}1000${FFFFFF} ]\n%s\n{ff0000}Выгрузить\n{cccccc}Сдать в аренду", \
global_str, \
CarInfo[number][cAlarmON] ? "{9ACD32}Выключить сигнализацию" : "{FF6347}Включить сигнализацию", \
IsPlayerRegCar(playerid, carid) ? "{73B461}Очистить список посредников '{FFD700}/keys'" : "{73B461}Вернуть ключи", \
CarInfo[number][cStyle] ? "{E4A72B}Sport" : "{73B461}Comfort", \
CarInfo[number][ConnectLoad] ? "Не загружать при авторизации" : "Загружать при авторизации");
SPD(playerid, 163, DIALOG_STYLE_LIST, mysql_string, global_str, !"Выбор", !"Отмена"), cache_delete(result);
}
case 163, 26926:
{
if !response *then
return false;
UseableCMDCars(playerid, listitem, OnPlayerCarLoad( ShowVeh[playerid] ), GetVehicleID(ShowVeh[playerid]), dialogid);
}
cmd:cars(playerid, dialog = 162)
{
format(global_str, 128, "SELECT * FROM ownable WHERE BINARY Owner = '%s'", PN(playerid));
new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid;
count = cache_get_row_count(mysql);
if !count *then
return SCMF(playerid, COLOR_S_1, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid));
if(GetPlayerLauncher(playerid) == 1 && dialog == 162)
{
if(ShowVeh[playerid] != -1)
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleInfoList', '[ null ]');"),
executeEvent(playerid, 0, "window.executeEvent('cef.modals.closeModal', `[\"carMenu\"]`);");
executeEvent(playerid, 0, "window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);");
}
global_str = "";
for new idx, numberData[4][10]; idx < count; idx++ do
{
if cache_get_row_int(idx, 40, mysql) != -1 *then
continue;
ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql);
carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid );
if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then
sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData);
if(GetPlayerLauncher(playerid) == 1 && dialog == 162)
{
if(carid)
f(mysql_string, sizeof(mysql_string), "{\"title\":\"%s\",\"icon\":\"icon-car-number\"},{\"title\":\"%s\",\"icon\":\"icon-fuel\"},", GetString(CarInfo[sqlid][cNumber], "Arizona ST") ? "Нет" : (str_f("[%s] %s (%s)", numberData[1], numberData[0], countryNumber[strval(numberData[3])])), !GetVehicleKindFuel(carid) ? "ДВЗ" : "Топливо");
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\
{\"id\":\"%i\",\"title\":\"%s\",\"sysName\":\"%i.png\",\"status\":\"%s\",\"labels\":[\
%s{\"title\":\"%s\",\"icon\":\"icon-id\"}]\
}]\
`);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? mysql_string : "", carid ? (str_f("%i", carid)) : "Не загружена")));
}
else
{
if !carid *then
format(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 33, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n");
else if CarInfo[sqlid][cShtraf] *then
format(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid);
else
{
switch VehicleInfo[carid][vModification] do
{
case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}";
case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}";
case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}";
case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}";
default: mysql_string = "";
}
format(global_str, 1024, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n");
}
}
}
if(GetPlayerLauncher(playerid) == 1 && dialog == 162)
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count))),
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid)))),
cursorPlayer(playerid, 0, true);
else
SPD(playerid, dialog, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена");
return cache_delete(result);
}
не работаетПривет!
Попробуй это:Pawn:cmd:cars(playerid, dialog = 162) { format(global_str, 128, "SELECT * FROM ownable WHERE BINARY Owner = '%s'", PN(playerid)); new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid; count = cache_get_row_count(mysql); if !count *then return SCMF(playerid, COLOR_S_1, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid)); if(GetPlayerLauncher(playerid) == 1 && dialog == 162) { if(ShowVeh[playerid] != -1) executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleInfoList', '[ null ]');"), executeEvent(playerid, 0, "window.executeEvent('cef.modals.closeModal', `[\"carMenu\"]`);"); executeEvent(playerid, 0, "window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);"); } global_str = ""; for new idx, numberData[4][10]; idx < count; idx++ do { if cache_get_row_int(idx, 40, mysql) != -1 *then continue; ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql); carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid ); if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData); if(GetPlayerLauncher(playerid) == 1 && dialog == 162) { if(carid) f(mysql_string, sizeof(mysql_string), "{\"title\":\"%s\",\"icon\":\"icon-car-number\"},{\"title\":\"%s\",\"icon\":\"icon-fuel\"},", GetString(CarInfo[sqlid][cNumber], "Arizona ST") ? "Нет" : (str_f("[%s] %s (%s)", numberData[1], numberData[0], countryNumber[strval(numberData[3])])), !GetVehicleKindFuel(carid) ? "ДВЗ" : "Топливо"); executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\ {\"id\":\"%i\",\"title\":\"%s\",\"sysName\":\"%i.png\",\"status\":\"%s\",\"labels\":[\ %s{\"title\":\"%s\",\"icon\":\"icon-id\"}]\ }]\ `);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? mysql_string : "", carid ? (str_f("%i", carid)) : "Не загружена"))); } else { if !carid *then format(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 33, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n"); else if CarInfo[sqlid][cShtraf] *then format(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid); else { switch VehicleInfo[carid][vModification] do { case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}"; case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}"; case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}"; case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}"; default: mysql_string = ""; } format(global_str, 1024, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n"); } } } if(GetPlayerLauncher(playerid) == 1 && dialog == 162) executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count))), executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid)))), cursorPlayer(playerid, 0, true); else SPD(playerid, dialog, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена"); return cache_delete(result); }
Надеюсь поможет
попробуй этот скриптсрочно помашь нужна
не работает
cmd:cars(playerid)
{
f(global_str, 256, "SELECT * FROM ownable WHERE Owner = '%s'", PN(playerid));
new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid;
count = cache_get_row_count(mysql);
if !count *then
return SCMF(playerid, COLOR_S_1, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid));
global_str = "";
if GetPlayerLauncher(playerid) == 1 *then
executeEvent(playerid, 0, !"window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);");
for new idx; idx < count; idx++ do
{
if cache_get_row_int(idx, 40, mysql) != -1 *then
continue;
ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql);
carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid );
if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then
sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData);
if GetPlayerLauncher(playerid) == 1 *then
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\
{\"id\":\"%i\",\
\"title\":\"%s\",\
\"sysName\":\"%d.png\",\
\"status\":\"%s\",\
\"labels\":[%s{\"title\":\"%s\",\"icon\":\"icon-id\"}]}]`);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? "{\"title\":\"Нет\",\"icon\":\"icon-car-number\"},{\"title\":\"Топливо\",\"icon\":\"icon-fuel\"}," : "", carid ? ( str_f("%d", carid)) : "Не загружена");
else
{
if !carid *then
f(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 40, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n");
else if CarInfo[sqlid][cShtraf] *then
f(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid);
else
{
switch VehicleInfo[carid][vModification] do
{
case 333: mysql_string = "{EADO63}[Supreme]{FFFFFF}";
case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}";
case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}";
case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}";
case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}";
default: mysql_string = "";
}
f(global_str, 2056, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n");
}
}
}
if GetPlayerLauncher(playerid) == 1 *then
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count ),
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid) );
else
SPD(playerid, 162, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена");
return cache_delete(result, mysql);
cursorPlayer(playerid, 0, true);
}
[15:04:04 12/08/24] [ERROR] cache_get_row_int - invalid datatype вот что в кансоле выдаётпопробуй этот скрипт
Pawn:cmd:cars(playerid) { f(global_str, 256, "SELECT * FROM ownable WHERE Owner = '%s'", PN(playerid)); new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid; count = cache_get_row_count(mysql); if !count *then return SCMF(playerid, COLOR_S_1, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid)); global_str = ""; if GetPlayerLauncher(playerid) == 1 *then executeEvent(playerid, 0, !"window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);"); for new idx; idx < count; idx++ do { if cache_get_row_int(idx, 40, mysql) != -1 *then continue; ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql); carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid ); if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData); if GetPlayerLauncher(playerid) == 1 *then executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\ {\"id\":\"%i\",\ \"title\":\"%s\",\ \"sysName\":\"%d.png\",\ \"status\":\"%s\",\ \"labels\":[%s{\"title\":\"%s\",\"icon\":\"icon-id\"}]}]`);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? "{\"title\":\"Нет\",\"icon\":\"icon-car-number\"},{\"title\":\"Топливо\",\"icon\":\"icon-fuel\"}," : "", carid ? ( str_f("%d", carid)) : "Не загружена"); else { if !carid *then f(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 40, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n"); else if CarInfo[sqlid][cShtraf] *then f(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid); else { switch VehicleInfo[carid][vModification] do { case 333: mysql_string = "{EADO63}[Supreme]{FFFFFF}"; case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}"; case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}"; case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}"; case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}"; default: mysql_string = ""; } f(global_str, 2056, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n"); } } } if GetPlayerLauncher(playerid) == 1 *then executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count ), executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid) ); else SPD(playerid, 162, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена"); return cache_delete(result, mysql); cursorPlayer(playerid, 0, true); }
[15:04:04 12/08/24] [ERROR] cache_get_row_int - invalid datatype вот что в кансоле выдаёт
cmd:cars(playerid)
{
format(global_str, 128, "SELECT * FROM ownable WHERE BINARY Owner = '%s'", PN(playerid));
new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid;
count = cache_get_row_count(mysql);
if !count *then
return SCMF(playerid, COLOR_S_1, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid));
global_str = "";
if GetPlayerLauncher(playerid) == 1 *then
executeEvent(playerid, 0, !"window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);");
for new idx, numberData[4][10]; idx < count; idx++ do
{
if cache_get_row_int(idx, 40, mysql) != -1 *then
continue;
ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql);
carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid );
if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then
sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData);
if GetPlayerLauncher(playerid) == 1 *then
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\
{\"id\":\"%i\",\
\"title\":\"%s\",\
\"sysName\":\"%d.png\",\
\"status\":\"%s\",\
\"labels\":[%s{\"title\":\"%s\",\"icon\":\"icon-id\"}]}]`);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? "{\"title\":\"Нет\",\"icon\":\"icon-car-number\"},{\"title\":\"Топливо\",\"icon\":\"icon-fuel\"}," : "", carid ? ( str_f("%d", carid)) : "Не загружена");
else
{
if !carid *then
f(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 40, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n");
else if CarInfo[sqlid][cShtraf] *then
f(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid);
else
{
switch VehicleInfo[carid][vModification] do
{
case 333: mysql_string = "{EADO63}[Supreme]{FFFFFF}";
case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}";
case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}";
case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}";
case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}";
default: mysql_string = "";
}
f(global_str, 2056, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n");
}
}
}
if GetPlayerLauncher(playerid) == 1 *then
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count ),
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid) );
else
SPD(playerid, 162, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена");
return cache_delete(result, mysql);
cursorPlayer(playerid, 0, true);
}
не работаетпопробуй этоPawn:cmd:cars(playerid) { format(global_str, 128, "SELECT * FROM ownable WHERE BINARY Owner = '%s'", PN(playerid)); new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid; count = cache_get_row_count(mysql); if !count *then return SCMF(playerid, COLOR_S_1, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid)); global_str = ""; if GetPlayerLauncher(playerid) == 1 *then executeEvent(playerid, 0, !"window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);"); for new idx, numberData[4][10]; idx < count; idx++ do { if cache_get_row_int(idx, 40, mysql) != -1 *then continue; ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql); carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid ); if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData); if GetPlayerLauncher(playerid) == 1 *then executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\ {\"id\":\"%i\",\ \"title\":\"%s\",\ \"sysName\":\"%d.png\",\ \"status\":\"%s\",\ \"labels\":[%s{\"title\":\"%s\",\"icon\":\"icon-id\"}]}]`);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? "{\"title\":\"Нет\",\"icon\":\"icon-car-number\"},{\"title\":\"Топливо\",\"icon\":\"icon-fuel\"}," : "", carid ? ( str_f("%d", carid)) : "Не загружена"); else { if !carid *then f(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 40, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n"); else if CarInfo[sqlid][cShtraf] *then f(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid); else { switch VehicleInfo[carid][vModification] do { case 333: mysql_string = "{EADO63}[Supreme]{FFFFFF}"; case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}"; case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}"; case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}"; case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}"; default: mysql_string = ""; } f(global_str, 2056, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n"); } } } if GetPlayerLauncher(playerid) == 1 *then executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count ), executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid) ); else SPD(playerid, 162, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена"); return cache_delete(result, mysql); cursorPlayer(playerid, 0, true); }
не работает
cmd:cars(playerid)
return ShowPlayerCars(playerid);
stock ShowPlayerCars(playerid, dialog = 162)
{
format(global_str, 128, "SELECT * FROM ownable WHERE BINARY Owner = '%s'", PN(playerid));
new Cache:result = mysql_query(mysql, global_str), count, carid, sqlid;
count = cache_get_row_count(mysql);
if !count *then
return SCMF(playerid, COLOR_OLDRED, "[Ошибка] {FFFFFF}У вас нет личного транспорта! {FFFF00}Доступно слотов для транспорта: {FFFFFF}%d", ValidNumberCars(playerid));
if GetPlayerLauncher(playerid) == 1 && dialog == 162 *then
{
if(ShowVeh[playerid] != -1)
executeEvent(playerid, 0, "window.executeEvent('event.vehicleMenu.setVehicleInfoList', '[ null ]');"),
executeEvent(playerid, 0, "window.executeEvent('cef.modals.closeModal', `[\"carMenu\"]`);");
executeEvent(playerid, 0, "window.executeEvent('cef.modals.showModal', `[\"carMenu\"]`);");
hidePlayerHud(playerid);
}
global_str = "";
for new idx, numberData[4][10]; idx < count; idx++ do
{
if cache_get_row_int(idx, 40, mysql) != -1 *then
continue;
ShowCar[playerid][idx][0] = cache_get_row_int(idx, 0, mysql), ShowCar[playerid][idx][1] = cache_get_row_int(idx, 1, mysql);
carid = OnPlayerCarLoad( ShowCar[playerid][idx][0] ), sqlid = GetVehicleID( carid );
if carid > 0 && !(GetString(CarInfo[sqlid][cNumber], "Arizona ST")) *then
sscanf(CarInfo[sqlid][cNumber], "P<,>a<s[10]>[4]", numberData);
if GetPlayerLauncher(playerid) == 1 && dialog == 162 *then
{
if(carid)
f(mysql_string, sizeof(mysql_string), "{\"title\":\"%s\",\"icon\":\"icon-car-number\"},{\"title\":\"%s\",\"icon\":\"icon-fuel\"},", GetString(CarInfo[sqlid][cNumber], "Arizona ST") ? "Нет" : (str_f("[%s] %s (%s)", numberData[1], numberData[0], countryNumber[strval(numberData[3])])), !GetVehicleKindFuel(carid) ? "ДВЗ" : "Топливо");
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.pushVehicleItem', `[\
{\"id\":\"%i\",\"title\":\"%s\",\"sysName\":\"%i.png\",\"status\":\"%s\",\"labels\":[\
%s{\"title\":\"%s\",\"icon\":\"icon-id\"}]\
}]\
`);", idx, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), 400 + SearchVehicleMassiveID(cache_get_row_int(idx, 1, mysql)), carid ? "loaded" : "notLoaded", carid ? mysql_string : "", carid ? (str_f("%i", carid)) : "Не загружена")));
}
else
{
if !carid *then
format(global_str, 1024, "%s{FF5E5E}[Не загружено]{FFFFFF} %s%s", global_str, GetVehicleName(cache_get_row_int(idx, 1, mysql), true), cache_get_row_int(idx, 33, mysql) ? "\t{cccccc}- загружается при входе\n" : "\n");
else if CarInfo[sqlid][cShtraf] *then
format(global_str, 1024, "%s{FF6347}[X]{FFFFFF} %s(%d)\n", global_str, GetVehicleName(carid), carid);
else
{
switch VehicleInfo[carid][vModification] do
{
case 548: mysql_string = "{EAD064}[Launch]{FFFFFF}";
case 578: mysql_string = "{EAD064}[Twin Turbo]{FFFFFF}";
case 587: mysql_string = "{EAD064}[Halloween]{FFFFFF}";
case 951: mysql_string = "{EAD064}[PREMIUM]{FFFFFF}";
default: mysql_string = "";
}
format(global_str, 1024, "%s%s%s %s(%d)%s", global_str, CarInfo[sqlid][cParkedInPark] ? "{FF6347}[Не припарковано]{FFFFFF}":"", mysql_string, GetVehicleName(carid), carid, CarInfo[sqlid][ConnectLoad] ? "\t{cccccc}- загружается при входе\n" : "\n");
}
}
}
if GetPlayerLauncher(playerid) == 1 && dialog == 162 *then
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleUsedSlot', `[%i]`);", count))),
executeEvent(playerid, 0, (str_f("window.executeEvent('event.vehicleMenu.setVehicleMaxSlot', `[%i]`);", ValidNumberCars(playerid)))),
cursorPlayer(playerid, 0, true);
else
SPD(playerid, dialog, DIALOG_STYLE_LIST, !"Мой транспорт", global_str, !"Выбор", !"Отмена");
return cache_delete(result, mysql);
}