public OnGameModeExit()
{
foreach(Factory, f) { SavePlayerFactory(f); printf("saving: %i",f); }
...............................................
stock SavePlayerFactory(factoryid)
{
new factoryid2 = FactoryInfo[factoryid][fSQLID];
format(string, sizeof(string), "UPDATE `factory` SET `X` = '%f', `Y` = '%f', `Z` = '%f', `Owner` = '%i', `Type` = '%i', `Stock` = '%f', `Bank` = '%i', `Lock` = '%i', `ProduceRate` = '%f', `Sell` = '%i' WHERE `SQLID` = '%d'",
FactoryInfo[factoryid][fPos][0],FactoryInfo[factoryid][fPos][1], FactoryInfo[factoryid][fPos][2],
FactoryInfo[factoryid][fOwnerID], FactoryInfo[factoryid][fType], FactoryInfo[factoryid][fStock], FactoryInfo[factoryid][fBank], FactoryInfo[factoryid][fLock], FactoryInfo[factoryid][ProduceRate],FactoryInfo[factoryid][fSell]/*FactoryInfo[factoryid][fBank], BusinessInfo[businessid][bSell]*/, factoryid2);
mysql_query(string);
mysql_free_result();
}
Gamemode closes before you even process with a single query.
I don't know why are you freeing result since you aren't evne saving it. I also don't know why do you use '' for floats. And I really don't know why you save everything when gamemdoe closes. If GF is doing that, it doesn't mean you should do it like that. Save things when they change. |
And I really don't know why you save everything when gamemdoe closes. |