29.04.2014, 05:25
Код:
[13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicBiz) - Data being passed to ProcessTick(). [13:46:17] [DEBUG] LoadDynamicBiz() - Callback is being called... [13:46:17] [DEBUG] >> cache_get_data(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [ERROR] >> cache_get_row_int(...) - An error occured during the datatype conversion. [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [ERROR] >> cache_get_row_int(...) - An error occured during the datatype conversion. [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [ERROR] >> cache_get_row_int(...) - An error occured during the datatype conversion. [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:17] [DEBUG] ProcessTick() - The cache has been cleared. [13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Executing query SELECT * FROM `foodstands`... [13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Query was successful. [13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Data caching enabled. [13:46:17] [DEBUG] CMySQLHandler::StoreResult() - Result was stored. [13:46:17] [DEBUG] CMySQLHandler::FreeResult() - Result was successfully freed. [13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Data being passed to ProcessTick(). [13:46:17] [DEBUG] LoadDynamicStands() - Callback is being called... [13:46:17] [DEBUG] >> cache_get_data(Connection handle: 1) [13:46:18] [DEBUG] >> cache_get_row_int(Connection handle: 1) [13:46:18] [DEBUG] >> cache_get_row(Connection handle: 1) [13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:18] [ERROR] >> cache_get_row_float(...) - An error occured during the datatype conversion. [13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1) [13:46:18] [DEBUG] ProcessTick() - The cache has been cleared.
PHP код:
public LoadDynamicBiz()
{
new rows, fields;
new total = 0;
cache_get_data(rows, fields);
if(rows)
{
while(total < rows)
{
BizInfo[total][bizID] = cache_get_row_int(total, 0);
BizInfo[total][bizPosX] = cache_get_row_float(total, 1);
BizInfo[total][bizPosY] = cache_get_row_float(total, 2);
BizInfo[total][bizPosZ] = cache_get_row_float(total, 3);
BizInfo[total][bizExitX] = cache_get_row_float(total, 4);
BizInfo[total][bizExitY] = cache_get_row_float(total, 5);
BizInfo[total][bizExitZ] = cache_get_row_float(total, 6);
cache_get_row(total, 7, BizInfo[total][bizName], dbHandle, 128);
cache_get_row(total, 8, BizInfo[total][bizInfo], dbHandle, 128);
cache_get_row(total, 9, BizInfo[total][bizEnterMSG], dbHandle, 128);
cache_get_row(total, 10, BizInfo[total][bizOwner], dbHandle, 128);
BizInfo[total][bizOwned] = cache_get_row_int(total, 11);
BizInfo[total][bizLocked] = cache_get_row_int(total, 12);
BizInfo[total][bizPrice] = cache_get_row_int(total, 13);
BizInfo[total][bizLevelbuy] = cache_get_row_int(total, 14);
BizInfo[total][bizInterior] = cache_get_row_int(total, 15);
BizInfo[total][bizWorld] = cache_get_row_int(total, 16);
BizInfo[total][bizCash] = cache_get_row_int(total, 17);
BizInfo[total][bizType] = cache_get_row_int(total, 18),
BizInfo[total][bizEntrance] = cache_get_row_int(total, 19);
BizInfo[total][bizRadio] = cache_get_row_int(total, 20);
BizInfo[total][bizOn] = 1;
BizInfo[total][bizPickUp] = CreateDynamicPickup(1239, 1, BizInfo[total][bizPosX], BizInfo[total][bizPosY], BizInfo[total][bizPosZ], -1, -1, -1, 100.0);
total++;
}
}
format(msg,sizeof(msg), "Loaded %d dynamic businesses from MySQL.", total);
printf(msg);
return 1;
}
PHP код:
stock UpdateHouseInfo(houseid)
{
new weapons[256];
FormatHouseWeapons(houseid, weapons);
format(query, sizeof(query), "UPDATE `houses` SET `owner` = '%s', `owned` = %d, `locked` = %d, `price`= %d, `levelbuy`= %d, `rentprice` = %d, `rentable` = %d, `interior` = %d, `world` = %d, `cash` = %d, `furnitures` = %d WHERE `id` = %d",
HouseInfo[houseid][hOwner],
HouseInfo[houseid][hOwned],
HouseInfo[houseid][hLocked],
HouseInfo[houseid][hPrice],
HouseInfo[houseid][hLevelbuy],
HouseInfo[houseid][hRentprice],
HouseInfo[houseid][hRentable],
HouseInfo[houseid][hInterior],
HouseInfo[houseid][hWorld],
HouseInfo[houseid][hCash],
HouseInfo[houseid][hFurnitures],
HouseInfo[houseid][hID]);
mysql_function_query(dbHandle, query, false, "", "");
format(query, sizeof(query), "UPDATE `houses` SET `checkx` = %f, `checky` = %f, `checkz` = %f, `weapons` = '%s', `exitx` = %f, `exity` = %f, `exitz` = %f, `posx` = %f, `posy` = %f, `posz` = %f, `info` = '%s', `radio` = %d WHERE `id` = %d",
HouseInfo[houseid][hCheckPosX],
HouseInfo[houseid][hCheckPosY],
HouseInfo[houseid][hCheckPosZ],
weapons,
HouseInfo[houseid][hExitX],
HouseInfo[houseid][hExitY],
HouseInfo[houseid][hExitZ],
HouseInfo[houseid][hEntranceX],
HouseInfo[houseid][hEntranceY],
HouseInfo[houseid][hEntranceZ],
HouseInfo[houseid][hInfo],
HouseInfo[houseid][hRadio],
HouseInfo[houseid][hID]);
mysql_function_query(dbHandle, query, false, "", "");
return 1;
}
stock AddHouseToFile(houseid, level, price, houseinfo[], Float:x, Float:y, Float:z)
{
format(query, sizeof(query), "INSERT INTO `houses` (posx, posy, posz, checkx, checky, checkz, info, price, levelbuy, owned, owner, cash, rentprice, rentable, locked, radio) VALUES(%f, %f, %f, %f, %f, %f, '%s', %d, %d, %d, '%s', %d, %d, %d, %d, %d)",
x, y, z, 0.0, 0.0, 0.0, houseinfo, price, level, 0, "The State", 0, 0, 0, 1, 0);
mysql_function_query(dbHandle, query, true, "OnHouseInsert", "d", houseid);
return 1;
}