Problem With OnGameModeInit
#1

When I run the server, OnGameModeInit stop working...
I have this:
pawn Код:
LoadAllVehicles();
    DeleteAllInvalidVehicles();
    LoadAllConcesionarias();
    LoadAllCasas();
    LoadAllDoors();
    LoadAllATMs();
pawn Код:
stock LoadAllDoors()
{
    new indexx = 0;
    for(new index = 1; index < MAX_CASAS; index ++)
    {
        if(fexist(DoorPath(index)))
        {
            DoorLoad(index, DoorPath(index));
            indexx++;
        }
        else
        {
            DestroyDoor(index);
        } // The for do all the loops, but in the last one, this is the final point
    }
    printf("====== DOORS CARGADAS: %d", indexx);
}
Help...
Thanks
Reply
#2

Try to disable each function one by one (just put // in front of it) to find out which function is causing the crash.
Reply
#3

Quote:
Originally Posted by Schneider
Посмотреть сообщение
Try to disable each function one by one (just put // in front of it) to find out which function is causing the crash.
Doesn't crash, only stop loading files and everything what is under "LoadAllDoors"
Reply
#4

I am not sure.

1. You are either flooding the start-up of the server when performing many functions at once which cause it to stop.
2. LoadAllDoors probably has a fuck-up or something like that, even though it doesn't give any errors, it still may be an issue, try commenting it and see if it'll continue doing the last one.

One suggestion which I believe will work, try setting a timer on start-up that'll wait untill the gamemode would load fully then load everything else, 5 second timer would do it I think.
You can also try to set a timer within each function to call the function that comes after it, that way you'll be less flooded and I believe will solve your issue.
Reply
#5

Quote:
Originally Posted by Ox1gEN
Посмотреть сообщение
I am not sure.

1. You are either flooding the start-up of the server when performing many functions at once which cause it to stop.
2. LoadAllDoors probably has a fuck-up or something like that, even though it doesn't give any errors, it still may be an issue, try commenting it and see if it'll continue doing the last one.

One suggestion which I believe will work, try setting a timer on start-up that'll wait untill the gamemode would load fully then load everything else, 5 second timer would do it I think.
You can also try to set a timer within each function to call the function that comes after it, that way you'll be less flooded and I believe will solve your issue.
1. I removed useless functions, and still happens...
2. LoadAllDoors before works... but now not... And I don't edit it.
3. I tried the timer, but I get a lot of errors with no sense...
I thought it was YSI, but I update the plugins and includes and still happens...
Reply
#6

Place printf statements everywhere in the code, you should be able to figure out where and why it stops working.
After each line of code, just print something to the server console.
When it suddenly stops printing, you've found the issue.
Reply
#7

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
Place printf statements everywhere in the code, you should be able to figure out where and why it stops working.
After each line of code, just print something to the server console.
When it suddenly stops printing, you've found the issue.
pawn Код:
stock LoadAllDoors()
{
    new indexx = 0;
    for(new index = 1; index < MAX_CASAS; index ++)
    {
        if(fexist(DoorPath(index)))
        {
            DoorLoad(index, DoorPath(index));
            indexx++;
        }
        else
        {
            DestroyDoor(index);
        } // There stops...
    }
    printf("====== DOORS CARGADAS: %d", indexx);
}
But I don't know why...

Edit:
pawn Код:
forward DestroyDoor(doorid);
public DestroyDoor(doorid)
{ // When doorid = 50, here finish :/
    dInformacion[doorid][dEntradaX] = 0.000000;
    dInformacion[doorid][dEntradaY] = 0.000000;
    dInformacion[doorid][dEntradaZ] = 0.000000;
    dInformacion[doorid][dSalidaX] = 0.000000;
    dInformacion[doorid][dSalidaY] = 0.000000;
    dInformacion[doorid][dSalidaZ] = 0.000000;
    dInformacion[doorid][dInInterior] = 0;
    ...
}
Reply
#8

Quote:
Originally Posted by FullCircle
Посмотреть сообщение
pawn Код:
stock LoadAllDoors()
{
    new indexx = 0;
    for(new index = 1; index < MAX_CASAS; index ++)
    {
        if(fexist(DoorPath(index)))
        {
            DoorLoad(index, DoorPath(index));
            indexx++;
        }
        else
        {
            DestroyDoor(index);
        } // There stops...
    }
    printf("====== DOORS CARGADAS: %d", indexx);
}
But I don't know why...

Edit:
pawn Код:
forward DestroyDoor(doorid);
public DestroyDoor(doorid)
{ // When doorid = 50, here finish :/
    dInformacion[doorid][dEntradaX] = 0.000000;
    dInformacion[doorid][dEntradaY] = 0.000000;
    dInformacion[doorid][dEntradaZ] = 0.000000;
    dInformacion[doorid][dSalidaX] = 0.000000;
    dInformacion[doorid][dSalidaY] = 0.000000;
    dInformacion[doorid][dSalidaZ] = 0.000000;
    dInformacion[doorid][dInInterior] = 0;
    ...
}
pawn Код:
stock LoadAllDoors()
{
    new indexx = 0;
    for(new index = 1; index < MAX_CASAS; index ++) // MAX_DOORS, no MAX_CASAS...
    {
        if(fexist(DoorPath(index)))
        {
            DoorLoad(index, DoorPath(index));
            indexx++;
        }
        else
        {
            DestroyDoor(index);
        } // There stops...
    }
    printf("====== DOORS CARGADAS: %d", indexx);
}
I'm Idiot lol...
Solved...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)