05.07.2017, 00:10
El cуdigo lo tengo asн:
Segъn la consola marca esto:
El random busca el negocio 7 pero como podrбs ver, dicho negocio no tiene el tipo 1 y por eso no aparece en la consola.
pawn Код:
new NumeroObtenido[MAXIMO_NEGOCIOS] = 0;
new negocios_tipo_1;
for (new i = 0; i < MAXIMO_NEGOCIOS; i ++) if (NegociosInfo[i][bizExists])
{
NumeroObtenido[i] = -1;
if (NegociosInfo[i][bizType] == 1)
{
NumeroObtenido[negocios_tipo_1] = i;
negocios_tipo_1 ++;
}
}
for (new i = 0; i < MAXIMO_NEGOCIOS; i ++) if (NegociosInfo[i][bizExists])
{
if(NumeroObtenido[i] != -1)
{
printf("%d", NumeroObtenido[i]);
}
}
new Valor2 = random(negocios_tipo_1);
MensajeDebug(Jugador, "Valor2 - %d", Valor2);
printf("Valor2 %d", Valor2);
DisablePlayerCheckpoint(Jugador);
SetPlayerCheckpoint(Jugador, NegociosInfo[Valor2][bizDeliver][0], NegociosInfo[Valor2][bizDeliver][1], NegociosInfo[Valor2][bizDeliver][2], 3.0);
SendInfoMensaje(Jugador, " El negocio fue marcado en tu gps.");
EnDestinoCamionero[Jugador] = true;
Код:
[01:54:45] 2 [01:54:45] 5 [01:54:45] 13 [01:54:45] 18 [01:54:45] 22 [01:54:45] 25 [01:54:45] 26 [01:54:45] 27 [01:54:45] 36 [01:54:45] 37 [01:54:45] Valor2 7