new Float:rotas[][] =
{
// rota 1
{-12.8889,153.9808,999.7769,359.9574},
{-14.7225,154.1146,999.7769,358.8459},
{-17.2141,151.6454,999.7769,90.7408},
{-17.1289,149.5033,999.7769,88.5500},
{-16.9197,147.5242,999.7769,86.9751},
{-17.0082,145.4394,999.7769,88.8385},
{-4.8342,148.1478,1000.0493,7.3137},
{-3.7265,148.7206,1000.0493,354.7095},
{-4.7265,148.7206,1000.0493,354.7095},
{-6.3055,153.1717,999.9245,89.3800}
// rota 2
{-12.8889,153.9808,999.7769,359.9574},
{-14.7225,154.1146,999.7769,358.8459},
{-17.2141,151.6454,999.7769,90.7408},
{-17.1289,149.5033,999.7769,88.5500},
{-16.9197,147.5242,999.7769,86.9751},
{-17.0082,145.4394,999.7769,88.8385},
{-4.8342,148.1478,1000.0493,7.3137},
{-3.7265,148.7206,1000.0493,354.7095},
{-4.7265,148.7206,1000.0493,354.7095},
{-6.3055,153.1717,999.9245,89.3800}
// rota 3
{-12.8889,153.9808,999.7769,359.9574},
{-14.7225,154.1146,999.7769,358.8459},
{-17.2141,151.6454,999.7769,90.7408},
{-17.1289,149.5033,999.7769,88.5500},
{-16.9197,147.5242,999.7769,86.9751},
{-17.0082,145.4394,999.7769,88.8385},
{-4.8342,148.1478,1000.0493,7.3137},
{-3.7265,148.7206,1000.0493,354.7095},
{-4.7265,148.7206,1000.0493,354.7095},
{-6.3055,153.1717,999.9245,89.3800}
};
new rand = random(sizeof(rotas));
SetPlayerCheckpoint(playerid,rotas[rand][0],rotas[rand][1],rotas[rand][2],2.0);
|
PHP код:
|
new Float:rota_1[][] =
{
// rota 1
{-12.8889,153.9808,999.7769,359.9574},
{-14.7225,154.1146,999.7769,358.8459},
{-17.2141,151.6454,999.7769,90.7408},
{-17.1289,149.5033,999.7769,88.5500},
{-16.9197,147.5242,999.7769,86.9751},
{-17.0082,145.4394,999.7769,88.8385},
{-4.8342,148.1478,1000.0493,7.3137},
{-3.7265,148.7206,1000.0493,354.7095},
{-4.7265,148.7206,1000.0493,354.7095},
{-6.3055,153.1717,999.9245,89.3800}
};
new Float:rota_2[][] =
{
// rota 2
{-12.8889,153.9808,999.7769,359.9574},
{-14.7225,154.1146,999.7769,358.8459},
{-17.2141,151.6454,999.7769,90.7408},
{-17.1289,149.5033,999.7769,88.5500},
{-16.9197,147.5242,999.7769,86.9751},
{-17.0082,145.4394,999.7769,88.8385},
{-4.8342,148.1478,1000.0493,7.3137},
{-3.7265,148.7206,1000.0493,354.7095},
{-4.7265,148.7206,1000.0493,354.7095},
{-6.3055,153.1717,999.9245,89.3800}
};
new Float:rota_3[][] =
{
// rota 3
{-12.8889,153.9808,999.7769,359.9574},
{-14.7225,154.1146,999.7769,358.8459},
{-17.2141,151.6454,999.7769,90.7408},
{-17.1289,149.5033,999.7769,88.5500},
{-16.9197,147.5242,999.7769,86.9751},
{-17.0082,145.4394,999.7769,88.8385},
{-4.8342,148.1478,1000.0493,7.3137},
{-3.7265,148.7206,1000.0493,354.7095},
{-4.7265,148.7206,1000.0493,354.7095},
{-6.3055,153.1717,999.9245,89.3800}
};
new getRandom = random(3); // {0, 1, 2}
if(getRandom == 0)
{
// -- Rota 1
}
else if(getRandom == 1)
{
// -- Rota 2
}
else if(getRandom == 2)
{
// -- Rota 3
}