SA-MP Forums Archive
[Duda] CP Random - 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: [Duda] CP Random (/showthread.php?tid=529985)



[Duda] CP Random - xTexTx - 04.08.2014

Hola, quiero hacer un CP que haga coordenadas ramdom, al momento de llegar al entrar al CP Random cumpla la misma funciуn que todos los demбs.

Tengo esto asн:
pawn Код:
// Ramdom Leсas
new Float:RandomLeсas[6][3] = {
{-378.2905,-1424.8539,25.7266},
{-373.5722,-1422.7974,25.7266},
{-367.5364,-1423.7897,25.7266},
{-364.8326,-1414.4440,25.7266},
{-370.5386,-1416.0521,25.7266},
{-377.2982,-1415.8378,25.7266}
};
pawn Код:
Checkpoint[5] = CreateDynamicCP(-378.2905,-1424.8539,25.7266, 5.0, -1, -1, -1, 9999999.0);
Como puedo hacer que ese Checkpoint envйs de dar esa coordenada, que de una al azar de las que estбn ahн arriba.
їUna ayudita?, Very thanks.


Respuesta: [Duda] CP Random - Juance - 04.08.2014

Tenes un ejemplo en la wiki.

https://sampwiki.blast.hk/wiki/Random


Respuesta: [Duda] CP Random - Swedky - 04.08.2014

їVery thanks? LOL.

Lo debes hacer asн:

pawn Код:
new const rand = random(sizeof(RandomLenas)); // La 'с' no estб permitida!
Checkpoint[5] = CreateDynamicCP(RandomLena[rand][0], RandomLenas[rand][1].....);



Respuesta: [Duda] CP Random - xTexTx - 05.08.2014

Vale, gracias.
Mi ingles es malo >.<

EDIT: Wi, gracias chicos los amo.


Respuesta: [Duda] CP Random - Swedky - 05.08.2014

Por ciero cбmbialo asн:

pawn Код:
static const Float:RandomWood[][] = { // Deja que el compilador calcule el tamaсo
{// Sigues tъ...



Respuesta: [Duda] CP Random - xTexTx - 05.08.2014

Nunca supe para que sirve 'static' :c


Re: [Duda] CP Random - 0xFFFFFF - 06.08.2014

Por que static const?


Respuesta: Re: [Duda] CP Random - Swedky - 06.08.2014

Quote:
Originally Posted by 0xFFFFFF
Посмотреть сообщение
Por que static const?
Porque es la mejor manera.