Avenue
Новичок
Дома создаются на нулевых координатах.В чём проблема?
Логи:
PHP:
public OnGameModeInit()
{
MySQLConnect ( ) ;
mysql_function_query(dbHandle,"SELECT * FROM `houses`",true,"OnHousesLoad","");
return 1;
}
PHP:
public OnHousesLoad()
{
new time = GetTickCount();
new string[128],klass[2];
new temp[32],rows,fields;
cache_get_data(rows,fields);
if(rows)
{
for(new idx = 1; idx <= rows; idx++)
{
cache_get_field_content(idx-1,"hID",temp,dbHandle), HouseInfo[idx][hID] = strval(temp);
cache_get_field_content(idx-1,"hOwned",temp,dbHandle), HouseInfo[idx][hOwned] = strval(temp);
cache_get_field_content(idx-1,"hOwner",HouseInfo[idx][hOwner],dbHandle);
cache_get_field_content(idx-1,"hEnterX",temp,dbHandle), HouseInfo[idx][hEnterX] = floatstr(temp);
cache_get_field_content(idx-1,"hEnterY",temp,dbHandle), HouseInfo[idx][hEnterY] = floatstr(temp);
cache_get_field_content(idx-1,"hEnterZ",temp,dbHandle), HouseInfo[idx][hEnterZ] = floatstr(temp);
cache_get_field_content(idx-1,"hExitX",temp,dbHandle), HouseInfo[idx][hExitX] = floatstr(temp);
cache_get_field_content(idx-1,"hExitY",temp,dbHandle), HouseInfo[idx][hExitY] = floatstr(temp);
cache_get_field_content(idx-1,"hExitZ",temp,dbHandle), HouseInfo[idx][hExitZ] = floatstr(temp);
cache_get_field_content(idx-1,"hLevel",temp,dbHandle), HouseInfo[idx][hLevel] = strval(temp);
cache_get_field_content(idx-1,"hPrice",temp,dbHandle), HouseInfo[idx][hPrice] = strval(temp);
cache_get_field_content(idx-1,"hLock",temp,dbHandle), HouseInfo[idx][hLock] = strval(temp);
cache_get_field_content(idx-1,"hTakings",temp,dbHandle), HouseInfo[idx][hTakings] = strval(temp);
cache_get_field_content(idx-1,"hInt",temp,dbHandle), HouseInfo[idx][hInt] = strval(temp);
cache_get_field_content(idx-1,"hHel",temp,dbHandle), HouseInfo[idx][hHel] = strval(temp);
cache_get_field_content(idx-1,"hClass",temp,dbHandle), HouseInfo[idx][hClass] = strval(temp);
TOTALHOUSES++;
if(HouseInfo[idx][hOwned] == 0)
{
HouseInfo[idx][hPickupID] = CreatePickup(1273, 23, HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ],-1);
HouseInfo[idx][hIconID] = CreateDynamicMapIcon(HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ], 31, COLOR_WHITE, 0, -1, -1, 200.0);
switch(HouseInfo[idx][hClass])
{
case 0: klass = "E";
case 1: klass = "D";
case 2: klass = "C";
case 3: klass = "B";
case 4: klass = "A";
case 5: klass = "S";
}
format(string,256,"Номер дома: %i\nЦена: %i долларов\nКласс: %s",idx,HouseInfo[idx][hPrice],klass);
HouseInfo[idx][hTextID] = Create3DTextLabel(string,COLOR_YELLOW,HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ],20.0,0,1);
}
else
{
HouseInfo[idx][hPickupID] = CreatePickup(1272, 23, HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ],-1);
HouseInfo[idx][hIconID] = CreateDynamicMapIcon(HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ], 32, COLOR_WHITE, 0, -1, -1, 200.0);
switch(HouseInfo[idx][hClass])
{
case 0: klass = "E";
case 1: klass = "D";
case 2: klass = "C";
case 3: klass = "B";
case 4: klass = "A";
case 5: klass = "S";
}
format(string,256,"Номер дома: %i\nВладелец: %s\nКласс: %s",idx,HouseInfo[idx][hOwner],klass);
HouseInfo[idx][hTextID] = Create3DTextLabel(string,COLOR_LIGHTRED,HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ],20.0,0,1);
}
}
}
printf("[Загружено домов]: <%i>. Времени затрачено: <%i мс>",TOTALHOUSES,GetTickCount()-time);
return true;
}
Код:
[04:28:15] ** MySQL Debugging enabled (07/11/16)
[04:28:15]
[04:28:15] >> mysql_query_callback( Connection handle: 1 )
[04:28:15] >> mysql_query_callback( Connection handle: 1 )
[04:28:15] Passing query SET NAMES cp1251 |
[04:28:15] ProcessQueryThread() - Query was successful. (SET NAMES cp1251)
[04:28:15] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[04:28:15] Passing query SELECT * FROM `houses` |
[04:28:15] ProcessQueryThread(OnHousesLoad) - Query was successful. (SELECT * FROM `houses`)
[04:28:15] ProcessQueryThread(OnHousesLoad) - Data caching enabled.
[04:28:15] CMySQLHandler::StoreResult() - Result was stored.
[04:28:15] CMySQLHandler::FreeResult() - Result was successfully free'd.
[04:28:15] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[04:28:15] OnHousesLoad() - Threaded function called.
[04:28:15] >> cache_get_data( Connection handle: 1 )
[04:28:15] ProcessTick() - The cache has been cleared.
