[Help] Loop, loops just once
#1

This is the loop:
pawn Код:
for(new b = 1; b < sizeof(BizInfo); b++)
it loops just once, and I got no returns/breaks
any ideas?
Reply
#2

What's the size of BizInfo?
Reply
#3

MAX_BIZ/250
pawn Код:
#define MAX_BIZ 250
Reply
#4

So if BizInfo is MAX_BIZ/250, and MAX_BIX is 250, then 250/250 is 1.

You only have one loop because your loop is basically like this:

pawn Код:
for(new b = 1; b < 1; b++)
Though I think that shouldn't loop at all...
Reply
#5

If what you're saying is right, so what to do? o_O
Reply
#6

First; why are you dividing MAX_BIZ by 250 when declaring BizInfo?

(I assume you have this or something similar somewhere in your code)
pawn Код:
new BizInfo[MAX_BIZ/250];
If you can answer that, then you can fix the problem...

Because that would only give you 1 possible biz. If you want more, you'd be better off makeing it look like this:

pawn Код:
new BizInfo[MAX_BIZ];
That will give you the full 250 biz's your looking for.
Reply
#7

pawn Код:
enum bInfo
{
    Float:bEntrancex,
    Float:bEntrancey,
    Float:bEntrancez,
    Float:bExitx,
    Float:bExity,
    Float:bExitz,
    bInt,
    bWorld,
    bPickup,
    bOwned,
    bOwner[MAX_PLAYER_NAME],
    Text3D:bLabel,
    bPrice,
    bName[256],
    bLocation[256],
    bTill,
    bProds,
    bType,
    bLock
}
new BizInfo[MAX_BIZ][bInfo];
Theres nothing wrong here, and it was this way before
Reply
#8

I am confused now; you said the size of BizInfo was MAX_BIZ/250...

Try changing

pawn Код:
for(new b = 1; b < sizeof(BizInfo); b++)
to

pawn Код:
for(new b = 1; b < MAX_BIZ; b++)
Reply
#9

Still the same
Reply
#10

Well, now I'm lost now to be honest.

If you want I could help you via msn or teamviewer; pm me if you want to do so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)