OnGameModeExit - Help
#1

hey, OnGameModeExit is called when I shut down the server right? Because When I do so, I can't find the INI file that's supposed to be in the "mapicons" folder in "scriptfiles"
pawn Code:
public OnGameModeExit()
{
    new i, INI:mapicondata = INI_Open("/mapicons/Mapicondata.INI");
    INI_SetTag(mapicondata, "data");
    INI_WriteInt(mapicondata, "nexticonid", nexticonid);
    INI_WriteInt(mapicondata, "number_of_deleted_mapicons", ndeletedmapicons);
    INI_WriteInt(mapicondata, "nextdeletedicon", nextdeletedicon);
    INI_SetTag(mapicondata, "saved_deleted_mapicons");
    for (i=0; i<=99; i++)
    {
        new savestring[128];
        format(savestring, 128, "deletedmapicon%i", i);
        INI_WriteInt(mapicondata, savestring, deletedmapicon[i]);
    }
    INI_Close(mapicondata);
    return 1;
}
No Compile Errors or warnings
Reply
#2

Well, - I would recommend one of the following,

1: - Creating the file by-hand(of-course you need the file created, unelss you make a code to do so automatically).
2: - Script a system so it detects if the file is created, and if not create it, and then write the data.
Reply
#3

Yes but OGME won't get called if you 'X' close the server console. Type exit instead, that was always the way we're supposed to do it...
Also, make sure that the folder "mapicons" exists.
Reply
#4

The server close in a fraction of second, thats why maybe the file is not created.
It justs ignore your script, cause the gamemode exit before your script execute.

Thats why people uses only GamModeExit to delete something or sends message, cause those functions are acutally faster than the callback itself.
So i recomand you to use a command for your instead, unless you fiind a way to make those functions faster.
Reply
#5

Quote:
Originally Posted by Virtual1ty
View Post
Yes but OGME won't get called if you 'X' close the server console. Type exit instead, that was always the way we're supposed to do it...
Also, make sure that the folder "mapicons" exists.
the mapicons folder exists
That's Cool , it works now, I had to type "exit" instead of closing it using the "X"
thanks alot +rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)