PDA

Просмотр полной версии : [Вопрос] Координаты в массиве



SteveStage
29.10.2019, 23:11
Вот, например, 100% нерабочий код:
https://pastebin.com/Rf6kC5vW

А как можно записать координаты в один массив, чтобы количество аргументов совпадало?
Создавать 3 массива под каждую ось не очень удобно, да и запутаться в собственных координатах будет очень легко

UPD:


new Float:AllBuyCarPos[12] = {
{568.5355, -1290.7661, 17.2422, 85.4159}, // LS Econom autosalon slot 1
{565.9220, -1286.2865, 17.2482, 108.4345}, // LS Econom autosalon slot 2
{564.8265, -1281.0807, 17.2482, 102.1676}, // LS Econom autosalon slot 3
{563.0193, -1275.8970, 17.2422, 104.0475}, // LS Econom autosalon slot 4
{561.3181, -1269.9225, 17.2422, 102.7941}, // LS Econom autosalon slot 5
{554.3326, -1262.7300, 17.2422, 215.9086}, // LS Econom autosalon slot 6
{550.9750, -1265.3616, 17.2422, 214.6552}, // LS Econom autosalon slot 7
{548.0053, -1267.5309, 17.2422, 214.6552}, // LS Econom autosalon slot 8
{545.8510, -1269.0607, 17.2482, 214.6552}, // LS Econom autosalon slot 9
{542.5486, -1271.7468, 17.2422, 214.0286}, // LS Econom autosalon slot 10
{539.9088, -1274.1699, 17.2422, 215.2819}, // LS Econom autosalon slot 11
{537.8700, -1276.7128, 17.2422, 216.8486}, // LS Econom autosalon slot 12
{534.2934, -1279.1741, 17.2422, 216.8486}, // LS Econom autosalon slot 13
};

UnO
30.10.2019, 02:03
new Float:AllBuyCarPos[12][4] = {
{568.5355, -1290.7661, 17.2422, 85.4159}, // LS Econom autosalon slot 1
{565.9220, -1286.2865, 17.2482, 108.4345}, // LS Econom autosalon slot 2
{564.8265, -1281.0807, 17.2482, 102.1676}, // LS Econom autosalon slot 3
{563.0193, -1275.8970, 17.2422, 104.0475}, // LS Econom autosalon slot 4
{561.3181, -1269.9225, 17.2422, 102.7941}, // LS Econom autosalon slot 5
{554.3326, -1262.7300, 17.2422, 215.9086}, // LS Econom autosalon slot 6
{550.9750, -1265.3616, 17.2422, 214.6552}, // LS Econom autosalon slot 7
{548.0053, -1267.5309, 17.2422, 214.6552}, // LS Econom autosalon slot 8
{545.8510, -1269.0607, 17.2482, 214.6552}, // LS Econom autosalon slot 9
{542.5486, -1271.7468, 17.2422, 214.0286}, // LS Econom autosalon slot 10
{539.9088, -1274.1699, 17.2422, 215.2819}, // LS Econom autosalon slot 11
{537.8700, -1276.7128, 17.2422, 216.8486}, // LS Econom autosalon slot 12
{534.2934, -1279.1741, 17.2422, 216.8486} // LS Econom autosalon slot 13
};

SteveStage
30.10.2019, 16:54
А как тогда его использовать?


car[ii][cVeh] = CreateVehicle(car[ii][cModel], AllBuyCarPos[ii], car[ii][cColor2], car[ii][cColor2], 0);


error 035: argument type mismatch (argument 2)

UnO
30.10.2019, 17:47
car[ii][cVeh] = CreateVehicle(car[ii][cModel], AllBuyCarPos[ii][0], AllBuyCarPos[ii][1], AllBuyCarPos[ii][2], AllBuyCarPos[ii][3], car[ii][cColor2], car[ii][cColor2], 0);

Как ты вообще что-то делаешь в павн не зная самых базовых вещей? Работа с массивами - одна из первых глав в любой книге по программированию. Это как писать текст, не изучив всех букв. Прочитай матчасть наконец и научись гуглить, а потом уже заходи сюда и спрашивай. На такие тупые вопросы больше отвечать не буду.