SA-MP Forums Archive
Cуmo se hacнa un array 3D tipo float? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Cуmo se hacнa un array 3D tipo float? (/showthread.php?tid=547414)



Cуmo se hacнa un array 3D tipo float? - Swedky - 22.11.2014

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.


Respuesta: Cуmo se hacнa un array 3D tipo float? - oOFotherOo - 22.11.2014

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.


Respuesta: Cуmo se hacнa un array 3D tipo float? - OTACON - 22.11.2014

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


Respuesta: Cуmo se hacнa un array 3D tipo float? - DesingMyCry - 22.11.2014

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
};



Re: Cуmo se hacнa un array 3D tipo float? - Daniel-92 - 22.11.2014

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
    }
};