Race position problem
#6

you've got a 2 dimensional array.

to make it look more understandable for humans:

pawn Код:
new Float:StartPositions[20][3] =
{
    // first dimension, the [20] part. means it can hold 20 rows with data.
    { // second dimension, first row of dimension 1( the [20] );
        -1418.0464, // the 0 index.
        -667.8558, // the 1 index.
        1058.8853 // the 2 index.
        // to make a 3th index, simply add one more line here, also don't forget to put a ',' behind the last coordinate, the one above this one.
    },
    {-1417.5392,-666.5084,1058.8463},
    {-1417.3503,-665.3151,1058.8364},
    {-1417.2483,-663.8860,1058.8359},
    {-1417.2594,-662.3469,1058.8485},
    {-1417.2816,-660.4011,1058.8645},
    {-1413.5150,-668.1015,1058.4664},
    {-1413.2587,-666.8832,1058.4520},
    {-1413.2622,-665.5123,1058.4636},
    {-1412.9541,-663.9665,1058.4440},
    {-1412.9523,-662.5579,1058.4547},
    {-1412.8295,-660.3596,1058.4595},
    {-1409.5519,-667.6078,1058.1082},
    {-1409.2167,-666.0783,1058.0879},
    {-1409.0236,-664.5811,1058.0840},
    {-1409.0116,-662.9490,1058.0924},
    {-1408.7771,-661.2306,1058.0844},
    {-1405.8873,-666.8409,1057.7815},
    {-1405.4391,-665.3012,1057.7515},
    {-1405.0856,-662.0101,1057.7426}
};

// so something like:
new Float:StartPositions[20][4] =
{
    {
        -1418.0464,
        -667.8558,
        1058.8853,
        180.0// add coordinate 4 here, with index nr 3. I assume this will be the facing angle coordinate?
    },
    {-1417.5392,-666.5084,1058.8463},
    {-1417.3503,-665.3151,1058.8364},
    {-1417.2483,-663.8860,1058.8359},
    {-1417.2594,-662.3469,1058.8485},
    {-1417.2816,-660.4011,1058.8645},
    {-1413.5150,-668.1015,1058.4664},
    {-1413.2587,-666.8832,1058.4520},
    {-1413.2622,-665.5123,1058.4636},
    {-1412.9541,-663.9665,1058.4440},
    {-1412.9523,-662.5579,1058.4547},
    {-1412.8295,-660.3596,1058.4595},
    {-1409.5519,-667.6078,1058.1082},
    {-1409.2167,-666.0783,1058.0879},
    {-1409.0236,-664.5811,1058.0840},
    {-1409.0116,-662.9490,1058.0924},
    {-1408.7771,-661.2306,1058.0844},
    {-1405.8873,-666.8409,1057.7815},
    {-1405.4391,-665.3012,1057.7515},
    {-1405.0856,-662.0101,1057.7426}
};

//then do
SetVehicleFacingAngle( GetPlayerVehicleID( playerid ), StartPositions[ pCounter ][ 3 ] );
you can easily pack those 5/6 lines back into 1 line, it's all the same to pawno, but for humans it might be better to understand.

for more information about multi-dimensional arrays, check this out:

https://sampforum.blast.hk/showthread.php?tid=318212
Reply


Messages In This Thread
Race position problem - by Zaec - 01.03.2014, 10:28
Re: Race position problem - by Smileys - 01.03.2014, 10:37
Re: Race position problem - by Zaec - 01.03.2014, 10:52
Re: Race position problem - by Smileys - 01.03.2014, 10:56
Re: Race position problem - by Zaec - 01.03.2014, 11:23
Re: Race position problem - by Smileys - 01.03.2014, 11:27
Re: Race position problem - by Zaec - 01.03.2014, 11:33
Re: Race position problem - by Zaec - 01.03.2014, 11:37
Re: Race position problem - by Konstantinos - 01.03.2014, 11:43
Re: Race position problem - by Zaec - 01.03.2014, 11:53

Forum Jump:


Users browsing this thread: 4 Guest(s)