28.06.2014, 15:27
pawn Код:
stock SetMap() {
new randomcategoria, string[32], contar;
for(new i = 0; i < max_i_spawn; i++) {
contar++;
printf("%d", contar);
randomcategoria = random(2);
switch(randomcategoria) {
case 0: {
randomspawn[i][item_ativo] = true;
randomspawn[i][item_categoria] = 1;
randomspawn[i][item_index] = random(5);
randomspawn[i][item_objeto] = CreateObject(Materiais[randomspawn[i][item_index]][m_objeto], randomspawn[i][item_x], randomspawn[i][item_x], randomspawn[i][item_x], 0.0, 0.0, 0.0, 300.0);
format(string, sizeof string, "%s (%d)", Materiais[randomspawn[i][item_index]][m_nome], i);
randomspawn[i][item_3d] = Create3DTextLabel(string, -1, randomspawn[i][item_x], randomspawn[i][item_x], randomspawn[i][item_x], 2.0, 0);
continue;
}
case 1: {
randomspawn[i][item_ativo] = true;
randomspawn[i][item_categoria] = 2;
randomspawn[i][item_index] = random(5);
randomspawn[i][item_objeto] = CreateObject(Comidas[randomspawn[i][item_index]][m_objeto], randomspawn[i][item_x], randomspawn[i][item_x], randomspawn[i][item_x], 0.0, 0.0, 0.0, 300.0);
format(string, sizeof string, "%s (%d)", Comidas[randomspawn[i][item_index]][m_nome], i);
randomspawn[i][item_3d] = Create3DTextLabel(string, -1, randomspawn[i][item_x], randomspawn[i][item_x], randomspawn[i][item_x], 2.0, 0);
continue;
}
}
}
printf("foi carregado %d itens", contar);
}