14.04.2015, 02:57
Guys if we cannot solve this. My problem : https://sampforum.blast.hk/showthread.php?tid=570342
Lets just skip that, and Proceed to my next problem.
Heres my problem. Is there any way to convert these mysql saving and loading saving into .ini saving and loading system? like fwrite ? fload ?
MYSQL Save
MYSQL Load
Is there any way to convert those codes above into .ini saving? For easy understand, Like saving and loading them all into .ini file inside the scriptfiles folder.
I know this is the hardest thing to code, I apologizes for those getting hardcore. I promise i will give ++REP on those who can help me out.
Lets just skip that, and Proceed to my next problem.
Heres my problem. Is there any way to convert these mysql saving and loading saving into .ini saving and loading system? like fwrite ? fload ?
MYSQL Save
pawn Code:
stock g_mysql_SaveMOTD()
{
new query[1024];
format(query, sizeof(query), "UPDATE `misc` SET ");
format(query, sizeof(query), "%s `gMOTD` = '%s',", query, g_mysql_ReturnEscaped(GlobalMOTD, MainPipeline));
format(query, sizeof(query), "%s `aMOTD` = '%s',", query, g_mysql_ReturnEscaped(AdminMOTD, MainPipeline));
format(query, sizeof(query), "%s `vMOTD` = '%s',", query, g_mysql_ReturnEscaped(VIPMOTD, MainPipeline));
format(query, sizeof(query), "%s `cMOTD` = '%s',", query, g_mysql_ReturnEscaped(CAMOTD, MainPipeline));
format(query, sizeof(query), "%s `pMOTD` = '%s',", query, g_mysql_ReturnEscaped(pMOTD, MainPipeline));
format(query, sizeof(query), "%s `ShopTechPay` = '%.2f',", query, ShopTechPay);
format(query, sizeof(query), "%s `GiftCode` = '%s',", query, g_mysql_ReturnEscaped(GiftCode, MainPipeline));
format(query, sizeof(query), "%s `GiftCodeBypass` = '%d',", query, GiftCodeBypass);
format(query, sizeof(query), "%s `TotalCitizens` = '%d',", query, TotalCitizens);
format(query, sizeof(query), "%s `TRCitizens` = '%d',", query, TRCitizens);
format(query, sizeof(query), "%s `ShopClosed` = '%d',", query, ShopClosed);
format(query, sizeof(query), "%s `RimMod` = '%d',", query, RimMod);
format(query, sizeof(query), "%s `CarVoucher` = '%d',", query, CarVoucher);
format(query, sizeof(query), "%s `PVIPVoucher` = '%d',", query, PVIPVoucher);
format(query, sizeof(query), "%s `GarageVW` = '%d',", query, GarageVW);
format(query, sizeof(query), "%s `PumpkinStock` = '%d',", query, PumpkinStock);
format(query, sizeof(query), "%s `HalloweenShop` = '%d'", query, HalloweenShop);
mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
pawn Code:
stock g_mysql_LoadMOTD()
{
mysql_function_query(MainPipeline, "SELECT `gMOTD`,`aMOTD`,`vMOTD`,`cMOTD`,`pMOTD`,`ShopTechPay`,`GiftCode`,`GiftCodeBypass`,`TotalCitizens`,`TRCitizens`,`SecurityCode`,`ShopClosed`,`RimMod`,`CarVoucher`,`PVIPVoucher`, `GarageVW`, `PumpkinStock`, `HalloweenShop` FROM `misc`", true, "OnQueryFinish", "iii", LOADMOTDDATA_THREAD, INVALID_PLAYER_ID, -1);
}
I know this is the hardest thing to code, I apologizes for those getting hardcore. I promise i will give ++REP on those who can help me out.