SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Русский/Russian

Reply
 
Thread Tools Display Modes
Old 16/09/2017, 07:22 AM   #1
Johhnyllll
Huge Clucker
 
Johhnyllll's Avatar
 
Join Date: Sep 2014
Posts: 230
Reputation: 8
Default Массив

Есть такой массив:
PHP Code:
new FloatBus_Route[2][][] =
{
    { 
// Мэрия ЛС - Авто Школа
        
{1110.8948,-1743.3965,13.4964},
        {
1160.6689,-1743.4645,13.4933},
        {
1172.8970,-1837.8068,13.5009},
        {
1285.0828,-1855.0142,13.4820},
        {
1392.6615,-1874.9890,13.4923},
        {
1552.3798,-1875.3862,13.4842},
        {
1572.0784,-1804.9308,13.4832},
        {
1572.0408,-1747.0170,13.4833},
        {
1485.0798,-1729.8295,13.4834},
        {
1327.0942,-1730.0822,13.4829},
        {
1315.0854,-1620.2205,13.4847},
        {
1359.2083,-1434.4419,13.4861},
        {
1282.7415,-1392.3820,13.3492},
        {
1092.5985,-1393.5048,13.6289},
        {
962.9703,-1392.9751,13.1946},
        {
817.1071,-1392.9729,13.4904},
        {
652.0573,-1392.2886,13.5745},
        {
508.2496,-1414.0692,16.0773},
        {
351.1371,-1517.6617,33.1659},
        {
263.9750,-1572.7380,33.0575},
        {
275.2678,-1515.1915,32.3513},
        {
265.4745,-1477.0023,28.5989},
        {
193.2150,-1518.1161,12.8864},
        {
155.4156,-1541.9231,10.9141},
        {
44.5384,-1521.4341,5.2417},
        {-
109.8505,-1478.1614,2.7960},
        {-
126.3167,-1204.4745,2.7949},
        {-
91.0433,-1122.6064,1.1905},
        {-
132.2491,-975.5624,26.2817},
        {-
283.8061,-876.6829,46.2458},
        {-
458.2804,-841.1224,50.1393},
        {-
596.6969,-966.3015,63.1597},
        {-
694.6760,-1005.2303,72.6382},
        {-
871.3551,-1067.1866,93.0333},
        {-
983.7172,-1017.6024,95.2420},
        {-
1098.2572,-900.4852,76.7594},
        {-
1210.7714,-784.2886,64.3183},
        {-
1271.2096,-791.9222,68.5489},
        {-
1448.6626,-817.1611,75.6686},
        {-
1590.3871,-798.5839,49.2870},
        {-
1740.6055,-719.1315,31.0045},
        {-
1759.3130,-598.7896,16.3743},
        {-
1802.5197,-576.0484,16.2331},
        {-
1969.0471,-577.0052,25.4459},
        {-
2073.5698,-562.2826,30.6403},
        {-
2171.4092,-472.6181,46.4921},
        {-
2251.4138,-316.0574,50.1557},
        {-
2252.7241,-204.7092,35.3994},
        {-
2251.7527,-85.0706,35.2692},
        {-
2182.1985,-72.8102,35.2699},
        {-
2025.9758,-72.7256,35.2732},
        {-
1936.7421,-67.5761,25.6511},
        {-
1814.3055,-118.7855,5.5972},
        {-
1801.6949,-218.7410,17.5603},
        {-
1806.4430,-344.0307,21.8520},
        {-
1821.0569,-432.2069,15.0385},
        {-
1821.6586,-560.9583,16.3355},
        {-
1782.4004,-584.7834,16.4371},
        {-
1758.2474,-705.4946,27.9469},
        {-
1606.0906,-799.9493,48.0662},
        {-
1481.5258,-823.6598,67.1627},
        {-
1346.1140,-817.6686,77.2409},
        {-
1238.1754,-779.9633,65.0068},
        {-
1159.1396,-845.0097,67.7793},
        {-
1065.3800,-941.5453,82.8673},
        {-
984.6949,-1024.7240,95.4520},
        {-
899.8729,-1111.6290,98.8397},
        {-
871.9296,-1086.9945,95.3129},
        {-
707.5451,-1011.3065,73.6916},
        {-
578.7609,-960.1398,61.6571},
        {-
484.5206,-866.9391,52.1205},
        {-
404.4693,-831.3943,47.6124},
        {-
313.9480,-871.3665,46.9655},
        {-
188.7889,-938.3931,34.2988},
        {-
98.0340,-1026.4336,24.2003},
        {-
95.0196,-1119.3201,1.2968},
        {-
133.4718,-1202.6857,2.8016},
        {-
151.5789,-1309.4395,2.7957},
        {-
154.7346,-1385.9117,2.7957},
        {-
136.3129,-1451.1656,2.7958},
        {-
88.1129,-1503.3081,2.7994},
        {-
37.5673,-1518.3154,1.9215},
        {
27.8760,-1535.4016,4.8932},
        {
159.8887,-1593.0145,13.1529},
        {
215.4980,-1662.1573,12.4454},
        {
324.7100,-1716.6766,6.6215},
        {
419.5761,-1719.3799,9.2523},
        {
545.2446,-1734.7151,12.5647},
        {
625.5590,-1747.7015,13.3689},
        {
780.0814,-1785.1552,13.1391},
        {
903.9519,-1789.4482,13.5027},
        {
1005.6660,-1809.7793,14.1503},
        {
1039.8827,-1735.4723,13.4826},
        {
1153.1807,-1714.4501,13.8834},
        {
1172.6649,-1837.1366,13.5075}
    },
    { 
// Мэрия ЛС - Банк
        
{0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0},
        {
0.0,0.0,0.0}
    }
}; 
Проблема в том что впервом маршруте для автобусника есть 95 координатов, во втором же, нужно что-бы было такое-же количество, если сделать меньше, начинает ругаться компиллятор. А если к примеру у меня 65 координатов во втором маршруте и 95 в первом, тогда мне нужно добавить там где 65 еще:
PHP Code:
{0.0,0.0,0.0
Пока не получится 95 пять строк в обоих маршрутах, такой вариант мне не очень нравится и я хочу узнать можно ли как-то сделать что-бы в одном массиве, было 95 строк у первого маршрута, а в другом 65?
Если да, то как можно это осуществить?
__________________
Мои проекты: GitHub

Last edited by Johhnyllll; 16/09/2017 at 01:12 PM.
Johhnyllll is offline   Reply With Quote
Old 16/09/2017, 08:50 AM   #2
Romz
High-roller
 
Romz's Avatar
 
Join Date: Jun 2013
Location: Ukraine
Posts: 1,076
Reputation: 64
Default Re: Массив

Делайте 2 массива.
Romz is offline   Reply With Quote
Old 16/09/2017, 12:04 PM   #3
stabker
High-roller
 
Join Date: Mar 2012
Posts: 1,320
Reputation: 86
Default Re: Массив

Сделайте еще один массив под инфу о маршруте (первый индекс из Bus_Route, количество чекпоинтов и т.д.), а этот сделайте двухмерным и храните все в куче.
stabker is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Массивчик и функции pozitiv4eg Русский/Russian 2 25/12/2015 02:58 PM
Массив. Skin123 Русский/Russian 10 29/08/2014 04:19 PM
Массив и значения Seregamil1 Русский/Russian 7 26/12/2013 02:40 PM
Таймер, массив Romz Русский/Russian 19 12/07/2013 06:49 AM
Как правильно объявить массив pozitiv4eg Русский/Russian 2 12/02/2013 05:45 PM


All times are GMT. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.