Как сделать пополнение товаров каждый час
stock tuningStationOpen(playerid, i)
{
new carid = GetPlayerVehicleID(playerid);
hidePlayerHud(playerid), SpeedometrSetting(playerid), SetPlayer_interfaceVisible(playerid, false);
tuningBox_player = playerid, pTemp[playerid][tSalonBox] = i, UpdateDynamic3DTextLabelText(tuningCenter3DText, 0xFFFFFFFF, "{EFBE51}Гараж занят");
LinkVehicleToInterior(carid, 3), SetVehicleVirtualWorld(carid, i);
SetVehiclePos(carid, tuningStation_boxInfo[1][0], tuningStation_boxInfo[1][1], tuningStation_boxInfo[1][2]), SetVehicleZAngle(carid, tuningStation_boxInfo[1][3]);
TogglePlayerControllable(playerid, false);
SetPlayerInterior(playerid, 3), SetPlayerVirtualWorld(playerid, i);
SetPlayerCameraPos(playerid, 1536.8762, 962.1998, 11.4604);
SetPlayerCameraLookAt(playerid, 1530.8762, 951.8074, 9.4604);
RETURN_STRING[3][0] = EOS, RETURN_STRING[6][0] = EOS;
RETURN_STRING[1] = "[\
{\"id\":0,\"name\": \"Двигатель\", \"icon\": \"engine.svg\"},\
{\"id\":1,\"name\": \"Трансмиссия\", \"icon\": \"transmission.svg\"},\
{\"id\":2,\"name\": \"Шасси\", \"icon\": \"chassis.svg\"},\
{\"id\":3,\"name\":\"Стайлинг\",\"icon\":\"bucket.svg\"},\
{\"id\":4,\"parentId\": 0, \"name\": \"Коленвал\", \"icon\": \"colenval.svg\", \"type\": \"componentList\"},\
{\"id\":5,\"parentId\": 0, \"name\": \"Распредвал\", \"icon\": \"raspredval.svg\", \"type\": \"componentList\"},\
{\"id\":6,\"parentId\": 0, \"name\": \"Турбина\", \"icon\": \"turbina.svg\", \"type\": \"componentList\"},\
{\"id\":7,\"parentId\": 0, \"name\": \"Прошивка\", \"icon\": \"chip.svg\", \"type\": \"componentList\"},\
{\"id\":8,\"parentId\": 1, \"name\": \"Сцепление\", \"icon\": \"sceplenie.svg\", \"type\": \"componentList\"},\
{\"id\":9,\"parentId\": 1, \"name\": \"КПП\", \"icon\": \"transmission.svg\", \"type\": \"componentList\"},\
{\"id\":10,\"parentId\": 1, \"name\": \"Дифференциал\", \"icon\": \"differential.svg\", \"type\": \"componentList\"},\
{\"id\":11,\"parentId\": 2, \"name\": \"Подвеска\", \"icon\": \"suspension.svg\", \"type\": \"componentList\"},\
{\"id\":12,\"parentId\": 2, \"name\": \"Тормоза\", \"icon\": \"brake.svg\", \"type\": \"componentList\"},\
{\"id\":13,\"parentId\":3,\"name\":\"Диски\",\"icon\":\"wheel.svg\",\"type\":\"colorList\"},\
{\"id\":14,\"parentId\":3,\"name\":\"Капот\",\"icon\":\"hood.svg\",\"type\":\"componentList\"},\
{\"id\":15,\"parentId\":3,\"name\":\"Спойлер\",\"icon\":\"spoiler.svg\",\"type\":\"componentList\"},\
{\"id\":16,\"parentId\":3,\"name\":\"Выхлоп\",\"icon\":\"exhaust.svg\",\"type\":\"componentList\"},\
{\"id\":17,\"parentId\":3,\"name\":\"Плёнка\",\"icon\":\"vinil.svg\",\"type\":\"colorList\"},\
{\"id\":18,\"parentId\":3,\"name\":\"Тонировка\",\"icon\":\"glass.svg\",\"type\":\"tintedWindow\"},\
{\"id\":19,\"parentId\":3,\"name\":\"Подвеска\",\"icon\":\"suspension.svg\",\"type\":\"sliderList\"},\
{\"id\":20,\"parentId\":3,\"name\":\"Цвет фар\",\"icon\":\"lights.svg\",\"type\":\"colorList\"},\
{\"id\":21,\"parentId\":3,\"name\":\"Цвет выхлопа\",\"icon\":\"exhaust_color.svg\",\"type\":\"colorList\"}]";
RETURN_STRING[2] = "[255,436797695,437453055,387580159,236585215,68813055,1705471,1707775,1710335,1186559,531199,16784127,167779071,335551231,436213503]";
RETURN_STRING[3] = "[1,1,2]";
RETURN_STRING[6] = "[{\"id\":67,\"color\":0,\"opacity\":100},{\"id\":68,\"color\":0,\"opacity\":100},{\"id\":69,\"color\":0,\"opacity\":100},{\"id\":70,\"color\":0,\"opacity\":100},{\"id\":71,\"color\":0,\"opacity\":100},{\"id\":72,\"color\":0,\"opacity\":100},{\"id\":87,\"color\":0,\"opacity\":100}]";
RETURN_STRING[4] = "[{\"type\":0,\"name\":\"Мощность\",\"value\":\"%s\",\"valueOffset\":0.0,\"valueMax\":245.0},{\"type\":1,\"name\":\"Устойчивость\",\"value\":\"%s\",\"valueOffset\":0.0,\"valueMax\":350.0},{\"type\":2,\"name\":\"Ускорение\",\"value\":\"%s\",\"valueOffset\":0.0,\"valueMax\":75.0},{\"type\":3,\"name\":\"Макс. Скорость\",\"value\":\"%s\",\"valueOffset\":0.0,\"valueMax\":800.0}]";
switch GetPlayerLauncherStatus(playerid) do
{
case 1:
{
executeEvent(playerid, 0, "window.executeEvent('event.setActiveView', [\"TuningStation\"]
);");
LoadTuningComponents(playerid, carid);
executeEvent(playerid, 0, (str_f("window.executeEvent('event.tuning.loadCategories', [%s]
);", RETURN_STRING[1])));
executeEvent(playerid, 0, (str_f("window.executeEvent('event.tuning.loadTintedWindowColors', '[%s]');", RETURN_STRING[2])));
executeEvent(playerid, 0, (str_f("window.executeEvent('event.tuning.setDashboardProperties', [%s]
);", RETURN_STRING[4])));
tuningStationUpdateClientData(playerid, carid);
executeEvent(playerid, 0, (str_f("window.executeEvent('event.tuning.loadTintedWindows', [%s]
);", RETURN_STRING[6])));
executeEvent(playerid, 0, (str_f("window.executeEvent('event.tuning.setColorsSelected', [%s]
);", RETURN_STRING[3])));
cursorPlayer(playerid, 0, true);
}
case 2:
{
cursorPlayer(playerid, 74, true);
LoadTuningComponents(playerid, carid);
eventMobile(playerid, {74, 1}, RETURN_STRING[1]);
eventMobile(playerid, {74, 8}, RETURN_STRING[4]);
tuningStationUpdateClientData(playerid, carid);
eventMobile(playerid, {74, 5}, RETURN_STRING[6]);
eventMobile(playerid, {74, 3}, RETURN_STRING[2]);
eventMobile(playerid, {74, 2}, RETURN_STRING[3]);
}
}
return true;
}