Dima_Tushin
Компетентный
Не полностью загружаются автомастерские
в базе 2 C.T.O загружается только 1
PHP:
stock LoadAvto() mysql_function_query(MYSQL,"SELECT * FROM `avto`", true, "CallBackLoadAvto", "");
publics: CallBackLoadAvto()
{
new tfme = GetTickCount();
new r, f;
cache_get_data(r, f, MYSQL);
new vresult[100], strfng2[300];
for(f = 0; f < r; f++)
{
cache_get_field_content(0, "avtoID", vresult,MYSQL); AvtoInfo[f][avtoID] = strval(vresult);
cache_get_field_content(0, "abOwned", vresult,MYSQL); AvtoInfo[f][abOwned] = strval(vresult);
cache_get_field_content(0, "abOwner", vresult,MYSQL); AvtoInfo[f][abOwner] = strval(vresult);
cache_get_field_content(0, "abMessage", vresult,MYSQL); AvtoInfo[f][abMessage] = strval(vresult);
cache_get_field_content(0, "abEntranceX", vresult,MYSQL); AvtoInfo[f][abEntranceX] = floatstr(vresult);
cache_get_field_content(0, "abEntranceY", vresult,MYSQL); AvtoInfo[f][abEntranceY] = floatstr(vresult);
cache_get_field_content(0, "abEntranceZ", vresult,MYSQL); AvtoInfo[f][abEntranceZ] = floatstr(vresult);
cache_get_field_content(0, "aExitX", vresult,MYSQL); AvtoInfo[f][aExitX] = floatstr(vresult);
cache_get_field_content(0, "aExitY", vresult,MYSQL); AvtoInfo[f][aExitY] = floatstr(vresult);
cache_get_field_content(0, "aExitZ", vresult,MYSQL); AvtoInfo[f][aExitZ] = floatstr(vresult);
cache_get_field_content(0, "abBuyPrice", vresult,MYSQL); AvtoInfo[f][abBuyPrice] = strval(vresult);
cache_get_field_content(0, "abWorld", vresult,MYSQL); AvtoInfo[f][abWorld] = strval(vresult);
cache_get_field_content(0, "abLocked", vresult,MYSQL); AvtoInfo[f][abLocked] = strval(vresult);
cache_get_field_content(0, "abInteifor", vresult,MYSQL); AvtoInfo[f][abInterior] = strval(vresult);
cache_get_field_content(0, "abPrice", vresult,MYSQL); AvtoInfo[f][abPrice] = strval(vresult);
cache_get_field_content(0, "abArenda", vresult,MYSQL); AvtoInfo[f][abArenda] = strval(vresult);
cache_get_field_content(0, "abTill", vresult,MYSQL); AvtoInfo[f][abTill] = strval(vresult);
cache_get_field_content(0, "picX", vresult,MYSQL); AvtoInfo[f][picX] = floatstr(vresult);
cache_get_field_content(0, "picY", vresult,MYSQL); AvtoInfo[f][picY] = floatstr(vresult);
cache_get_field_content(0, "picZ", vresult,MYSQL); AvtoInfo[f][picZ] = floatstr(vresult);
cache_get_field_content(0, "abZp", vresult,MYSQL); AvtoInfo[f][abZp] = strval(vresult);
cache_get_field_content(0, "Rab", vresult,MYSQL); AvtoInfo[f][Rab] = strval(vresult);
cache_get_field_content(0, "Poset", vresult,MYSQL); AvtoInfo[f][Poset] = strval(vresult);
cache_get_field_content(0, "Mesto", vresult,MYSQL); AvtoInfo[f][Mesto] = strval(vresult);
f++;
CreateDynamicObject(18728, AvtoInfo[f][picX],AvtoInfo[f][picY],AvtoInfo[f][picZ], 0.0000, 0.0000, 100.000);
AvtoInfo[f][abLabel] = Create3DTextLabel("~~~~~~~~~~~~~~~~~\nЗаказ\nтюнинга\n/buytune\n~~~~~~~~~~~~~~~~~",COLOR_YELLOW,AvtoInfo[f][picX],AvtoInfo[f][picY],AvtoInfo[f][picZ],20.0,AvtoInfo[f][abWorld],1);
if(AvtoInfo[f][abOwned] == 0)
{
AddStaticPickup(19132, 23, AvtoInfo[f][abEntranceX], AvtoInfo[f][abEntranceY], AvtoInfo[f][abEntranceZ]);
format(strfng2, sizeof(strfng2), "Автомастерская: %s\nЦена: %d\nПродаётся",AvtoInfo[f][abMessage],AvtoInfo[f][abBuyPrice]);
AvtoInfo[f][abLocked] = 1;
AvtoInfo[f][abLabel] = Create3DTextLabel(strfng2,COLOR_YELLOW,AvtoInfo[f][abEntranceX], AvtoInfo[f][abEntranceY], AvtoInfo[f][abEntranceZ],20.0,0,1);
}
if(AvtoInfo[f][abOwned] == 1)
{
AddStaticPickup(19132, 23, AvtoInfo[f][abEntranceX], AvtoInfo[f][abEntranceY], AvtoInfo[f][abEntranceZ]);
format(strfng2,sizeof(strfng2), "Автомастерская:%s\nВладелец:\n%s", AvtoInfo[f][abMessage], AvtoInfo[f][abOwner]);
AvtoInfo[f][abLabel] = Create3DTextLabel(strfng2,TEAM_GROVE_COLOR,AvtoInfo[f][abEntranceX], AvtoInfo[f][abEntranceY], AvtoInfo[f][abEntranceZ],20.0,0,1);
}
CreateDynamicMapIcon(AvtoInfo[f][abEntranceX], AvtoInfo[f][abEntranceY], AvtoInfo[f][abEntranceZ],27,0);
}
printf("[Загрузка мастерских]: Было загружено - %d потрачено %d (ms)", f, GetTickCount() - tfme);
return true;
}
