Cуmo se hacнa un array 3D tipo float?
#1

Despuйs de un largo tiempo me olvidй cуmo se hacнa. Lo que quiero hacer es algo asн:

pawn Код:
static const Float:Races[MAX_RACES][MAX_CHECK_POINTS][3] =
{
    ... ???
};
Pasa que no se cуmo seguir.

Saludos.
Reply
#2

pawn Код:
static const Float:Races[5][2][3] =
{
    {{0,{{1.0,1.5, 1.5, 2.5, 3.5},{1.0,1.5,1.5,2.5, 3.5}},
    1,{{1.0,1.5, 1.5, 2.5, 3.5},{1.0,1.5,1.5,2.5, 3.5}},
    2,{{1.0,1.5, 1.5, 2.5, 3.5},{1.0,1.5,1.5,2.5, 3.5}}}
};
PD: No lo probй pero deberнa ser asн.

Un saludo.
Reply
#3

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

Hay varias formas de hacerlo. Te darй un ejemplo:

pawn Код:
static const Float:Races[9][5][3] =
{
    //    2D 0                2D 1                2D 2                2D 3                2D 4
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 0
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 1
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 2
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 3
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 4
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 5
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 6
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}, // Primer dimensiуn: ID 7
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}} // Primer dimensiуn: ID 8
    //  0    1     2        0    1     2        0    1     2        0    1     2        0    1     2
};
Reply
#5

Asн mбs bonito.
pawn Код:
new const Float:Races[][][] = {
    //CARRERA 1
    {
        {0.00,0.00,0.00},   //CP 1
        {0.00,0.00,0.00}    //CP 2
    },
    //CARRERA 2
    {
        {0.00,0.00,0.00},   //CP 1
        {0.00,0.00,0.00}    //CP 2
    },
    //CARRERA 3
    {
        {0.00,0.00,0.00},   //CP 2
        {0.00,0.00,0.00}    //CP 3
    }
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)