New to Loops such as these ones, any advice?
#2

I dont exactly understand what you are trying to do but if you are just trying to get one id, something like below should work. If you remove break you will see all ids.

Important edit: You should never match database id with in game object id that your script gives. Just create another variable called dbid in your enum and do your database jobs on that id. Its fool proof and less resource requiring since you are taking down your loop workload.

Code:
for(new i=0; i<maxbiz; i++)
{
    if(biz[i][taken]==free)
    {
        //The id you want is i. i is free. Do your action here.
        Break;
    }
}
Reply


Messages In This Thread
New to Loops such as these ones, any advice? - by SkyFlare - 18.07.2020, 06:34
Re: New to Loops such as these ones, any advice? - by grymtn - 18.07.2020, 07:43
Re: New to Loops such as these ones, any advice? - by GameOvr - 18.07.2020, 08:01
Re: New to Loops such as these ones, any advice? - by SkyFlare - 18.07.2020, 08:11
Re: New to Loops such as these ones, any advice? - by xRadical3 - 18.07.2020, 08:48

Forum Jump:


Users browsing this thread: 1 Guest(s)