OnGameModeInit
#1

Hey,

How to make sure all of OnGameModeInIt is Called?
All my player files and houses and cars dont all save, even though they are in loops it starts the loop then starts the nest thing?

Is there any way to solve this without saving everything one by one.
Reply
#2

try it on
pawn Код:
GameModeExit
Reply
#3

First of all, you can save them OnPlayerDisconnect Or OnGameModeExit (Optional).
Also, to check if the Callback is called use print.
pawn Код:
OnGameModeInit( )
{
    print( "It has been called" );
    return 1;
}
Run the samp-server.exe and if the text appear on the console then it is called.
Reply
#4

Sorry I ment OnGameModeExit its because i'm talking to somone on Skype and he said it as I worte this. I dont have a clue why it continues when the Loop osnt finished.
Reply
#5

pawn Код:
public OnGameModeExit()
{
    for(new i = 0; i < MAX_HOUSES;i++)
    {
        if(fexist(HousePath(i))
        {
            SaveHouse(i);
        }
    }
    for(new i = 0; i < MAX_VEHICLES;i++)
    {
        if(fexist(VehiclePath(i))
        {
            SaveVehicle(i);
        }
    }
    return 1;
}

These are the loops it only does 1 or 2 of the others are short loops and run fully
Reply
#6

OnGameModeExit you can save the Data after close samp-server.exe
When you mention above that all the player files aren't saved, are you sure that you don't use only OnGameModeExit Callback, but you are using OnPlayerDisconnect to save the data.
Reply
#7

I tthink i've found the problem with it if it continues i'll bump this post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)