09.04.2015, 11:19
(
Последний раз редактировалось PURG3D; 15.04.2015 в 01:19.
)
Here are my codes below.
My problem is , I set MOTD in server. But when i restart the server it looses the MOTD. In short, It doesnt save my MOTD into "misc" table.
Heres the loading mysql function.
I dont know if the problem is in Loading function or Saving function. Im confuse.
My problem is , I set MOTD in server. But when i restart the server it looses the MOTD. In short, It doesnt save my MOTD into "misc" table.
pawn Код:
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 Код:
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);
}