Code crashing
#1

So its quite simple this code is making me crash for some reason

PHP код:
#define MAX_TOYS 15000
CreateToyHere(Float:sX,Float:sY,Float:sZ,Float:sA) {
    for(new 
cID 0cID MAX_TOYScID++) {
        if(
ToyInfo[cID][ConeX] == 0.0 && ToyInfo[cID][ConeX] == 0.0 && ToyInfo[cID][ConeX] == 0.0) {
            
ToyInfo[cID][ConeX] = sX;
            
ToyInfo[cID][ConeY] = sY;
            
ToyInfo[cID][ConeZ] = sZ;
            
ToyInfo[cID][ConeAngle] = sA;
            
ToyInfo[cID][ConeObject] = CreateDynamicObject(973sXsYsZ0,0, -sA);
        }
    }
    return 
true;

Reply
#2

Sorry, I'm confused what is it you're asking?

Why is the code crashing?
Reply
#3

You need use 'break' because its creating 15000 objects in your server
Reply
#4

Quote:
Originally Posted by Jefff
Посмотреть сообщение
You need use 'break' because its creating 15000 objects in your server
Pretty much what he said.
Your foreach statement creates 15,000 Objects
You never tell it when to stop,
You just say while X < 15,000 - Repeat the action
Reply
#5

Mi mom gave me a birth and she dropped me... Thanks a lot guys! Yeah was correct, was creating 15k objects... (stupid me ...)
+rep
Reply
#6

Lol Np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)