Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Next without for compile error.......
#1
this is pissing me off. is there a fix for this code at all because the next at the end keep saying next without for and when i take them out i have to keep adding end if to the end of the sub but it never stops weird.

Code:
' //////////////////////////////////////
                ' // This is used for spawning an NPC //
                ' //////////////////////////////////////
                ' Check if we are supposed to spawn an npc or not
                If MapNpc(y, x).Num = 0 And Map(y).Npc(x) > 0 Then
                    If TickCount > MapNpc(y, x).SpawnWait + (Npc(Map(y).Npc(x)).SpawnSecs * 1000) Then
                        Call SpawnNpc(x, y)
                    End If
                End If
            Next x
        End If
        DoEvents
    Next y


this is the part causing the problems

Code:
Next x

thank you for your help.
Reply
#2
Oh lawd.

*cough*

You've fucked up one of your fucking if, when, whiles or loops. Well done.

Now go through your fucking code and actually read whats going on.

This is why some people fucking indent their fucking code!

So you can actually find out whats wrong with the fucking thing, ok?

The broken if, when, while or loop is somewhere before your "while x = fuck" and before your "next x".

Go look for it instead of annoying us with this fucking fucking problem.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
well that was a little uncalled for. well thank you for helping me robin, i was so lost in what i was doing i forgot what i did to the loop lol.
Reply
#4
IMHO I don't think it was.

If you're going to ask us about the basics of the basics of code structure, at least use proper English.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#5
genusis Wrote:this is pissing me off. is there a fixe for this code at all becuase the nexts at the end keep saying next without for and when i take them out i have to keep adding end if to the end of the sub but it never stops wierd.
Who, when, wha?? Confusedhock:.

People are not going to take you seriously if you don't put some effort into explaining yourself.
I am not a great speller, so i use Firefox as my browser, it has spell check. :wink:
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)