max amount [+rep]
#8

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
If you want max 250 objects then try this

new MAX_HOUSEOBJECTS = 250;

for(new 1 = 0; 1 < MAX_HOUSEOBJECTS; i++)
Wrong. Then every time he wants to create a variable with MAX_HOUSEOBJECTS, he cannot do it without raising an error.

Eg.
pawn Код:
new variable[MAX_HOUSEOBJECTS];
This is still the best suggestion:
pawn Код:
Furniture[MAX_HOUSES][MAX_OBJECTS_PER_HOUSE];
Why would you have 250 furniture per house? That's ridiculous, you will never use up 250 objects on a single house... even 30 is an acceptable limit per house...

--

It depends what you're trying to do... if you're looping through ALL house objects in EVERY house, then you need to loop through all houses at the same time.

pawn Код:
for(new h = 0; h < MAX_HOUSES; h++)
{
    //check if house exists here?
    //check if house is owned here?
    for(new i = 0; i < MAX_OBJECTS_PER_HOUSE; i++)
    {
        if(!IsValidDynamicObject(Furniture[h][i])) continue;
        //Everything can be done where objectid = Furniture[h][i]
    }
}
Reply


Messages In This Thread
max amount [+rep] - by iBots - 16.04.2015, 23:24
Re: max amount [+rep] - by iiNzTicTx - 16.04.2015, 23:40
Re: max amount [+rep] - by iBots - 16.04.2015, 23:53
Re: max amount [+rep] - by iiNzTicTx - 17.04.2015, 08:32
Re: max amount [+rep] - by iBots - 17.04.2015, 08:40
Re: max amount [+rep] - by fuckingcruse - 17.04.2015, 08:59
Re: max amount [+rep] - by ATGOggy - 17.04.2015, 09:19
Re: max amount [+rep] - by Threshold - 17.04.2015, 10:51

Forum Jump:


Users browsing this thread: 1 Guest(s)