11.01.2018, 09:29
O que estб errado neste code? o correto seria spawnar todos os objetos, mas spawna no mбximo 5.
Nгo estб apresentando nenhum erro de compilaзгo, porem nгo estб spawnando todos os objetos
No topo
Code que faz spawnar - "ou pelo menos deveria"
Porque nгo estб spawnando os 20 objetos? o que hб de errado?
Nгo estб apresentando nenhum erro de compilaзгo, porem nгo estб spawnando todos os objetos
No topo
PHP код:
#define MAX_LITTER (20)
PHP код:
new LitterPlaced[MAX_LITTER];
new LitterObjects[9] = {2837, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677};
[b]Spawn[/b]
new Float:LitterSpawns[MAX_LITTER][3] = // -= 0.975
{
// MONTGOMERY
{1225.847534, 361.662536, 18.646},
{1236.861206, 358.277465, 18.646},
{1254.182495, 348.228546, 18.646},
{1260.515991, 347.994812, 18.646},
{1271.184204, 347.472229, 18.646},
{1270.432006, 358.401916, 18.646},
{1283.298095, 372.864929, 18.646},
{1286.481201, 385.211303, 18.646},
{1302.524169, 381.480560, 18.646},
{1315.692871, 376.586822, 18.646},
{1329.069946, 370.357482, 18.646},
{1334.440673, 371.284515, 18.646},
{1342.016479, 383.921020, 18.646},
{1346.587646, 396.525512, 18.646},
{1369.796752, 409.847747, 18.646},
{1365.009277, 391.824615, 18.646},
{1351.626708, 370.961486, 18.646},
{1341.249511, 349.476989, 18.646},
{1331.825927, 324.745666, 18.646},
{1316.262817, 330.530395, 18.646}
}
PHP код:
//Spawn lixos
if(gLitterCount < MAX_LITTER)
{
new litter_idx = random(sizeof(LitterSpawns));
if(LitterPlaced[litter_idx] > 0)
{
litter_idx = GetNextFreeLitterSpot();
}
if(litter_idx != -1)
{
LitterPlaced[litter_idx] = CreateDynamicObject(LitterObjects[random(sizeof(LitterObjects))], LitterSpawns[litter_idx][0], LitterSpawns[litter_idx][1], LitterSpawns[litter_idx][2], 0.0, 0.0, float(random(360)));
gLitterCount ++;
}
}