kotana
Ученик
перевёл систему домов на mysql r7
получается так что загружаются 2 дома а стоит 1 если даже 3 поставить всё равно 1 появляется
а сохраняется 2 дома как 1
скриншот структуры таблицы
вот mysql log
---------- Post added at 19:48 ---------- Previous post was at 18:57 ----------
ап!! ну помогите же
PHP:
public SaveHouses()
{
new str[3000];
for(new i = 0; i <= TotalHouse)
{
format(str, sizeof(str), "UPDATE `Houses` SET `EnterX`=%f,`EnterY`=%f,`EnterZ`=%f, `ExitX`=%f,`ExitY`=%f", HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ], HouseInfo[i][hExitX], HouseInfo[i][hExitY]);
format(str, sizeof(str), "%s,`ExitZ`=%f,`Int`=%d,`Owned`=%d,`Owner`='%s',`Price`=%d,`Lock`=%d WHERE ID = %d",str, HouseInfo[i][hExitZ], HouseInfo[i][hInt], HouseInfo[i][hOwned], HouseInfo[i][hOwner], HouseInfo[i][hPrice], HouseInfo[i][hLock],HouseInfo[i][hID]);
mysql_function_query(1, str, false, "", "");
i++;
}
return 1;
}
public LoadHouses()
{
/*new string[288];
new arrCoords[12][46];
new File:houses = fopen("properties/Houses.cfg", io_read);
new i;
if(houses)
{
while(i < HOME)
{
fread(houses, string);
split(string, arrCoords, '|');
HouseInfo[i][hID] = strval(arrCoords[0]);
HouseInfo[i][hEnterX] = floatstr(arrCoords[1]);
HouseInfo[i][hEnterY] = floatstr(arrCoords[2]);
HouseInfo[i][hEnterZ] = floatstr(arrCoords[3]);
HouseInfo[i][hExitX] = floatstr(arrCoords[4]);
HouseInfo[i][hExitY] = floatstr(arrCoords[5]);
HouseInfo[i][hExitZ] = floatstr(arrCoords[6]);
HouseInfo[i][hInt] = strval(arrCoords[7]);
HouseInfo[i][hOwned] = strval(arrCoords[8]);
strmid(HouseInfo[i][hOwner], arrCoords[9], false, strlen(arrCoords[9]), MAX_PLAYER_NAME+1);
HouseInfo[i][hPrice] = strval(arrCoords[10]);
HouseInfo[i][hLock] = strval(arrCoords[11]);
i++;
}
}*/
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
for(new h = 0; h <= rows; h++)
{
MYSQL_GetInt(0,HouseInfo[h][hID]);
MYSQL_GetFloat(1,HouseInfo[h][hEnterX]);
MYSQL_GetFloat(2,HouseInfo[h][hEnterY]);
MYSQL_GetFloat(3,HouseInfo[h][hEnterZ]);
MYSQL_GetFloat(4,HouseInfo[h][hExitX]);
MYSQL_GetFloat(5,HouseInfo[h][hExitY]);
MYSQL_GetFloat(6,HouseInfo[h][hExitZ]);
MYSQL_GetInt(7,HouseInfo[h][hInt]);
MYSQL_GetInt(8,HouseInfo[h][hOwned]);
MYSQL_GetString(9,HouseInfo[h][hOwner]);
MYSQL_GetInt(10,HouseInfo[h][hPrice]);
MYSQL_GetInt(11,HouseInfo[h][hLock]);
TotalHouse ++;
new text[600];
if(HouseInfo[h][hOwned] == 0)
{
format(text,sizeof(text),"{FF6347}* Дом *{FFFFFF}\nАдрес: {7CFC00}Samp Exclusive %d{FFFFFF}\nЦена: {7CFC00}$%d{FFFFFF}",h,HouseInfo[h][hPrice]);
HouseInfo[h][hPickup] = CreatePickup(1274, 23, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ],-1);
HouseInfo[h][hMIcon] = CreateDynamicMapIcon(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 31, COLOR_WHITE, 0, -1, -1, 400.0);
}
else if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hRentabil] == 1)
{
format(text,sizeof(text),"{FF6347}* Дом *{FFFFFF}\nАдрес: {7CFC00}Samp Exclusive %d{FFFFFF}\nВладелец: {7CFC00}%s{FFFFFF}",h,HouseInfo[h][hOwner]);
}
else if(HouseInfo[h][hRentabil] == 0)
{
format(text,sizeof(text),"{FF6347}* Дом *{FFFFFF}\nАдрес: {7CFC00}%d{FFFFFF}\nВладелец: {7CFC00}%s{FFFFFF}",h,HouseInfo[h][hOwner]);
}
HouseInfo[h][hMIcon] = CreateDynamicMapIcon(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 32, COLOR_WHITE, 0, -1, -1, 400.0);
HouseInfo[h][hPickup] = CreatePickup(1272, 23, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ],-1);
}
HouseInfo[h][hLabel] = Create3DTextLabel(text,0xFFFFFFFF,HouseInfo[h][hEnterX],HouseInfo[h][hEnterY],HouseInfo[h][hEnterZ]+1,20.0,0,1);
}
}
printf("|Домов: %d",rows);
printf("Дома загружены");
return 1;
}
а сохраняется 2 дома как 1
скриншот структуры таблицы
вот mysql log
PHP:
[22:36:55] ProcessQueryThread() - Query was successful. (UPDATE `Houses` SET `EnterX`=2211.309326,`EnterY`=-1141.056518,`EnterZ`=25.814571, `ExitX`=2365.210449,`ExitY`=-1135.633789,`ExitZ`=1050.882568,`Int`=8,`Owned`=1,`Owner`='The State',`Price`=1200000,`Lock`=0 WHERE ID = 1)
[22:36:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[22:36:55] Passing query UPDATE `Houses` SET `EnterX`=2211.309326,`EnterY`=-1141.056518,`EnterZ`=25.814571, `ExitX`=2365.210449,`ExitY`=-1135.633789,`ExitZ`=1050.882568,`Int`=8,`Owned`=1,`Owner`='The State',`Price`=1200000,`Lock`=0 WHERE ID = 1 |
[22:36:55] ProcessQueryThread() - Query was successful. (UPDATE `Houses` SET `EnterX`=2211.309326,`EnterY`=-1141.056518,`EnterZ`=25.814571, `ExitX`=2365.210449,`ExitY`=-1135.633789,`ExitZ`=1050.882568,`Int`=8,`Owned`=1,`Owner`='The State',`Price`=1200000,`Lock`=0 WHERE ID = 1)
[22:36:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[22:36:55] Passing query UPDATE `Houses` SET `EnterX`=2211.309326,`EnterY`=-1141.056518,`EnterZ`=25.814571, `ExitX`=2365.210449,`ExitY`=-1135.633789,`ExitZ`=1050.882568,`Int`=8,`Owned`=1,`Owner`='The State',`Price`=1200000,`Lock`=0 WHERE ID = 1 |
[22:36:55] ProcessQueryThread() - Query was successful. (UPDATE `Houses` SET `EnterX`=2211.309326,`EnterY`=-1141.056518,`EnterZ`=25.814571, `ExitX`=2365.210449,`ExitY`=-1135.633789,`ExitZ`=1050.882568,`Int`=8,`Owned`=1,`Owner`='The State',`Price`=1200000,`Lock`=0 WHERE ID = 1)
[22:36:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[22:36:55] Passing query UPDATE `Houses` SET `EnterX`=2211.309326,`EnterY`=-1141.056518,`EnterZ`=25.814571, `ExitX`=2365.210449,`ExitY`=-1135.633789,`ExitZ`=1050.882568,`Int`=8,`Owned`=1,`Owner`='The State',`Price`=1200000,`Lock`=0 WHERE ID = 1 |
[22:36:55] ProcessQueryThread() - Query was successful. (UPDATE `Houses` SET `EnterX`=2211.309326,`EnterY`=-1141.056518,`EnterZ`=25.814571, `ExitX`=2365.210449,`ExitY`=-1135.633789,`ExitZ`=1050.882568,`Int`=8,`Owned`=1,`Owner`='The State',`Price`=1200000,`Lock`=0 WHERE ID = 1)
[22:36:55] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
PHP:
[22:36:31] Passing query SELECT * FROM `Houses` |
[22:36:31] ProcessQueryThread(LoadHouses) - Query was successful. (SELECT * FROM `Houses`)
[22:36:31] ProcessQueryThread(LoadHouses) - Data caching enabled.
[22:36:31] CMySQLHandler::StoreResult() - Result was stored.
[22:36:31] CMySQLHandler::FreeResult() - Result was successfully free'd.
[22:36:31] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[22:36:32] LoadHouses() - Threaded function called.
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] >> cache_get_data( Connection handle: 1 )
[22:36:32] ProcessTick() - The cache has been cleared.
---------- Post added at 19:48 ---------- Previous post was at 18:57 ----------
ап!! ну помогите же
