08.01.2012, 19:21
Estou criando um spawn aleatorio de armas. mas da o erro:
error 029: invalid expression, assumed zero
Thx For All!
error 029: invalid expression, assumed zero
pawn Код:
new armas[18] = {4, 9, 22, 23, 24, 25, 27, 26, 28, 29, 30, 31, 32, 33, 34, 42, 41}, rand, rand2, rand3, rand4;
for(new i; i < 4; i ++)
{
if(!i)
{
rand = armas[random(sizeof armas)];
GivePlayerWeapon(playerid, rand, 15000);
}
else if(i == 1)
{
Start:
rand2 = armas[random(sizeof armas)];
if(rand2 == rand) goto Start;
GivePlayerWeapon(playerid, rand2, 15000);
}
else
{
Start2:
rand3 = armas[random(sizeof armas)];
if(rand3 == rand2 || rand3 == rand) goto Start2;
GivePlayerWeapon(playerid, rand3, 15000);
}
else // Linha do ERRO.
{
Start3:
rand4 = armas[random(sizeof armas)];
if(rand4 == rand3 || rand4 == rand2) goto Start3;
GivePlayerWeapon(playerid, rand4, 15000);
}
}
#pragma unused armas