Vehicle variable
#1

Hey guys,

Im trying to add all vehicles of a seperate location in one variable. Im not sure what im doing wrong, but can anyone help me out?

pawn Код:
new AP3Array[MAX_AP3_VEHICLES][7] =
{
    { 520, 1600.5023, 1188.8260, 11.5386, 42.5816, 0, 0 },
    { 520, 1590.3354, 1186.7863, 11.5350, 37.1616, 0, 0 },
    { 520, 1580.8839, 1183.1765, 11.5400, 37.7007, 0, 0 },
    { 520, 1571.5887, 1177.8109, 11.5293, 359.0632, 0, 0 },
    { 520, 1561.3468, 1186.1890, 11.5304, 332.6406, 0, 0 },
    { 520, 1604.6086, 1174.4469, 14.9483, 36.1946, 0, 0 },
    { 522, 1306.2991, 1278.8601, 10.3917, 358.4577, 6, 25 },
    { 522, 1328.5786, 1279.0802, 10.3895, 177.6847, 7, 79 },
    { 522, 1325.4536, 1279.5922, 10.3917, 359.9543, 8, 82 },
    { 490, 1309.4993, 1279.2419, 10.7624, 359.7906, 0, 0 },
    { 596, 1312.7015, 1279.1237, 10.5508, 359.2922, 0, 1 },
    { 560, 1315.9567, 1278.8680, 10.5251, 0.2303, 9, 39 },
    { 402, 1320.2401, 1279.1045, 10.6519, 0.1929, 13, 13 }
};
'MAX_AP3_VEHICLES' is defined as '50'.

pawn Код:
//ongamemodeinit
    for( new i = 0; i < MAX_AP3_VEHICLES; i ++ )
    {
        AddStaticVehicle(AP3Array[i][0], AP3Array[i][1], AP3Array[i][2], AP3Array[i][3], AP3Array[i][4], AP3Array[i][5], AP3Array[i][6]);
    }
~Wesley
Reply
#2

pawn Код:
1600.5023
That's a float.
Reply
#3

So i have to add Float: before the every float in here?

Edit: i just tried it, it now looks like this:
pawn Код:
new AP3Array[MAX_AP3_VEHICLES][7] =
{
    { 520, Float:1600.5023, Float:1188.8260, Float:11.5386, Float:42.5816, 0, 0 }, // 64
    { 520, Float:1590.3354, Float:1186.7863, Float:11.5350, Float:37.1616, 0, 0 },
    { 520, Float:1580.8839, Float:1183.1765, Float:11.5400, Float:37.7007, 0, 0 },
    { 520, Float:1571.5887, Float:1177.8109, Float:11.5293, Float:359.0632, 0, 0 },
    { 520, Float:1561.3468, Float:1186.1890, Float:11.5304, Float:332.6406, 0, 0 },
    { 520, Float:1604.6086, Float:1174.4469, Float:14.9483, Float:36.1946, 0, 0 },
    { 522, Float:1306.2991, Float:1278.8601, Float:10.3917, Float:358.4577, 6, 25 },
    { 522, Float:1328.5786, Float:1279.0802, Float:10.3895, Float:177.6847, 7, 79 },
    { 522, Float:1325.4536, Float:1279.5922, Float:10.3917, Float:359.9543, 8, 82 },
    { 490, Float:1309.4993, Float:1279.2419, Float:10.7624, Float:359.7906, 0, 0 },
    { 596, Float:1312.7015, Float:1279.1237, Float:10.5508, Float:359.2922, 0, 1 },
    { 560, Float:1315.9567, Float:1278.8680, Float:10.5251, Float:0.2303, 9, 39 },
    { 402, Float:1320.2401, Float:1279.1045, Float:10.6519, Float:0.1929, 13, 13 } // 76
}; // 77
With the errors:
Код:
F:\TestServer\gamemodes\TestserverBeta.pwn(64) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(64) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(64) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(64) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(65) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(65) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(65) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(65) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(66) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(66) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(66) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(66) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(67) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(67) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(67) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(67) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(68) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(68) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(68) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(68) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(69) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(69) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(69) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(69) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(70) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(70) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(70) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(70) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(71) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(71) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(71) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(71) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(72) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(72) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(72) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(72) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(73) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(73) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(73) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(73) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(74) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(74) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(74) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(74) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(75) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(75) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(75) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(75) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(76) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(76) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(76) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(76) : warning 213: tag mismatch
F:\TestServer\gamemodes\TestserverBeta.pwn(77) : error 052: multi-dimensional arrays must be fully initialized
Reply
#4

pawn Код:
enum Vehs
{
    ModelID,
    Float:X,
    Float:Y,
    Float:Z,
    Float:A,
    color1,
    color2
}
new AP3Array[12][Vehs] =
{
    { 520, 1600.5023, 1188.8260, 11.5386, 42.5816, 0, 0 },
    { 520, 1590.3354, 1186.7863, 11.5350, 37.1616, 0, 0 },
    { 520, 1580.8839, 1183.1765, 11.5400, 37.7007, 0, 0 },
    { 520, 1571.5887, 1177.8109, 11.5293, 359.0632, 0, 0 },
    { 520, 1561.3468, 1186.1890, 11.5304, 332.6406, 0, 0 },
    { 520, 1604.6086, 1174.4469, 14.9483, 36.1946, 0, 0 },
    { 522, 1306.2991, 1278.8601, 10.3917, 358.4577, 6, 25 },
    { 522, 1328.5786, 1279.0802, 10.3895, 177.6847, 7, 79 },
    { 522, 1325.4536, 1279.5922, 10.3917, 359.9543, 8, 82 },
    { 490, 1309.4993, 1279.2419, 10.7624, 359.7906, 0, 0 },
    { 596, 1312.7015, 1279.1237, 10.5508, 359.2922, 0, 1 },
    { 560, 1315.9567, 1278.8680, 10.5251, 0.2303, 9, 39 },
    { 402, 1320.2401, 1279.1045, 10.6519, 0.1929, 13, 13 }
};

 for( new i = 0; i < MAX_AP3_VEHICLES; i ++ )
    {
        AddStaticVehicle(AP3Array[i][ModelID], AP3Array[i][X], AP3Array[i][Y], AP3Array[i][Z], AP3Array[i][A], AP3Array[i][color1], AP3Array[i][color2]);
    }
Reply
#5

You can extract them of make all of them become float
pawn Код:
//example
new AP3Array[MAX_AP3_VEHICLES][3] =
{
    { 520, 0, 0 },
    { 520, 0, 0 },
    { 520, 0, 0 },


new Float:blahblahblah[MAX_AP3_VEHICLES][4] =
{
    {1600.5023, 1188.8260, 11.5386, 42.5816},
    {1590.3354, 1186.7863, 11.5350, 37.1616},
    {1580.8839, 1183.1765, 11.5400, 37.7007}
Reply
#6

Quote:
Originally Posted by [MWR]Blood
Посмотреть сообщение
pawn Код:
enum Vehs
{
    ModelID,
    Float:X,
    Float:Y,
    Float:Z,
    Float:A,
    color1,
    color2
}
new AP3Array[12][Vehs] =
{
    { 520, 1600.5023, 1188.8260, 11.5386, 42.5816, 0, 0 },
    { 520, 1590.3354, 1186.7863, 11.5350, 37.1616, 0, 0 },
    { 520, 1580.8839, 1183.1765, 11.5400, 37.7007, 0, 0 },
    { 520, 1571.5887, 1177.8109, 11.5293, 359.0632, 0, 0 },
    { 520, 1561.3468, 1186.1890, 11.5304, 332.6406, 0, 0 },
    { 520, 1604.6086, 1174.4469, 14.9483, 36.1946, 0, 0 },
    { 522, 1306.2991, 1278.8601, 10.3917, 358.4577, 6, 25 },
    { 522, 1328.5786, 1279.0802, 10.3895, 177.6847, 7, 79 },
    { 522, 1325.4536, 1279.5922, 10.3917, 359.9543, 8, 82 },
    { 490, 1309.4993, 1279.2419, 10.7624, 359.7906, 0, 0 },
    { 596, 1312.7015, 1279.1237, 10.5508, 359.2922, 0, 1 },
    { 560, 1315.9567, 1278.8680, 10.5251, 0.2303, 9, 39 },
    { 402, 1320.2401, 1279.1045, 10.6519, 0.1929, 13, 13 }
};

 for( new i = 0; i < MAX_AP3_VEHICLES; i ++ )
    {
        AddStaticVehicle(AP3Array[i][ModelID], AP3Array[i][X], AP3Array[i][Y], AP3Array[i][Z], AP3Array[i][A], AP3Array[i][color1], AP3Array[i][color2]);
    }
Thanks, didnt even think of that

Quote:
Originally Posted by =WoR=Varth
Посмотреть сообщение
You can extract them of make all of them become float
pawn Код:
//example
new AP3Array[MAX_AP3_VEHICLES][3] =
{
    { 520, 0, 0 },
    { 520, 0, 0 },
    { 520, 0, 0 },


new Float:blahblahblah[MAX_AP3_VEHICLES][4] =
{
    {1600.5023, 1188.8260, 11.5386, 42.5816},
    {1590.3354, 1186.7863, 11.5350, 37.1616},
    {1580.8839, 1183.1765, 11.5400, 37.7007}
Im just gonna use the other one above; rep for both
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)