Maximum Number for For Loop

Hello All i have a loop to check some stuff. If i set a for loop like
for(new i=0; i<600000; i++)
this causes Command Crash and returns me Command Not Found. What is the maximum number i can have it checked?

For loops can be infinite, what's causing the crash is what you're using with it.

i used to use MAX_OBJECTS which is 1000 instead of 600000 only thing i changed in the command is that and when it was MAX_OBJECTS it worked fine.

Well since you haven't posted any code, I can only assume you're creating or modifying objects. The for loop does not have a limit, but objects do, hence the 'MAX_OBJECTS' defined value.

The for loop itself can't be causing a crash, but something that deals with the variable being incremented may be causing it to crash. Perhaps something you're doing is causing a stack overflow, I'd suggest compiling the script with debugging features and using something such as crashdetect so you can get a stack trace of what's going on once it crashes.

To compile with debugging features enabled:
pawn Code:
pawncc yourscript.pwn -;+ -(+ -d3

Forum Jump:

Users browsing this thread: