12.08.2018, 01:08
How can I make this system only spawn 5 giftboxes / 100 at one time.
PHP код:
function:OnLoadGiftboxes()
{
new rows = cache_num_rows();
new iCount;
if(rows)
{
new iGet[128];
for(new i = 0, l = rows; i != l; i++)
{
cache_get_field_content(i, "gbox_x", iGet); Giftboxes[i][gbox_x] = floatstr(iGet);
cache_get_field_content(i, "gbox_y", iGet); Giftboxes[i][gbox_y] = floatstr(iGet);
cache_get_field_content(i, "gbox_z", iGet); Giftboxes[i][gbox_z] = floatstr(iGet);
Giftboxes[i][gbox_active]=false;
// ActivateGiftboxes(5); when I put here, all giftboxes spawned.
iCount++;
}
}
// ActivateGiftboxes(5); When I put here, it shows only 5 objects but spawned at 0,0,0, cords (blueberry).
printf("[Debug - Giftboxes] A total of %d/%d/%d giftboxes have been loaded from the database.", iCount, rows, MAX_GIFTBOXES);
return 1;
}