04.09.2012, 07:51
Hello!
I'm using MySQL R7 plugin and this is my problem: Whenever I call "rcon gmx" or "rcon exit" I have to save using MySQL all in-game data like factions, gang zones, players, vehicles and some other settings. But, if I do that in OnGameModeExit using the mysql_function_query function, it'll start another thread which will end later than the one in which OnGameModeExit is running, so the server will close before all queries are executed/data is saved.
Could you give me any idea about how I can work this out? I need to find a way to sleep the server thread while MySQL queries are executed.
I asked a few more guys and followed some other threads about this issue, but there was no solution that actually works. I've been trying to use a while (!...) { }, where ... was a function that would check if all queries have finished, but I found out that it freezes everything.
Thank you very much!
I'm using MySQL R7 plugin and this is my problem: Whenever I call "rcon gmx" or "rcon exit" I have to save using MySQL all in-game data like factions, gang zones, players, vehicles and some other settings. But, if I do that in OnGameModeExit using the mysql_function_query function, it'll start another thread which will end later than the one in which OnGameModeExit is running, so the server will close before all queries are executed/data is saved.
Could you give me any idea about how I can work this out? I need to find a way to sleep the server thread while MySQL queries are executed.
I asked a few more guys and followed some other threads about this issue, but there was no solution that actually works. I've been trying to use a while (!...) { }, where ... was a function that would check if all queries have finished, but I found out that it freezes everything.
Thank you very much!