PHP код:
mysql_tquery(1, "SELECT * FROM `houses`", "LoadHouses", ""); // OnGameModeInit
forward LoadHouses();
public LoadHouses()
{
new time = GetTickCount();
for(new id = 1; id <= cache_num_rows(); ++id)
{
new ORM:h = hInfo[id][hORM_ID] = orm_create("houses");
orm_addvar_int(h, hInfo[id][hID], "id");
orm_setkey(h, "id");
orm_addvar_string(h, hInfo[id][hOwner], 40, "Owner");
printf("Owner: %s",hInfo[id][hOwner]);
orm_addvar_string(h, hInfo[id][hPosEnterAll], 40, "PosEnter");
sscanf(hInfo[id][hPosEnterAll], "p<,>a<f>[3]",hInfo[id][hPosEnter]);
orm_addvar_string(h, hInfo[id][hPosExitAll], 40, "PosExit");
sscanf(hInfo[id][hPosExitAll], "p<,>a<f>[3]",hInfo[id][hPosExit]);
orm_addvar_int(h, hInfo[id][hInterior], "Interior");
orm_addvar_int(h, hInfo[id][hCost], "Cost");
orm_addvar_int(h, hInfo[id][hCar], "Car");
orm_addvar_int(h, hInfo[id][hC_Model], "C_Model");
orm_addvar_string(h, hInfo[id][hC_PosAll], 50, "C_Pos");
sscanf(hInfo[id][hC_PosAll], "p<,>a<f>[4]",hInfo[id][hC_Pos]);
orm_addvar_string(h, hInfo[id][hC_Colors], 7, "C_Colors");
sscanf(hInfo[id][hC_Colors], "p<,>a<d>[2]",hInfo[id][hC_Color]);
hInfo[id][hPickup][0] = CreateDynamicPickup(strcmp("None", hInfo[id][hOwner], true) == 0 ? 1273 : 1272, 22, hInfo[id][hPosEnter][0], hInfo[id][hPosEnter][1], hInfo[id][hPosEnter][2]);
hInfo[id][hPickup][1] = CreateDynamicPickup(1273, 22, hInfo[id][hPosExit][0], hInfo[id][hPosExit][1], hInfo[id][hPosExit][2], id+House_VirtWorld, hInfo[id][hInterior]);
hInfo[id][hMapIcon] = CreateDynamicMapIcon(hInfo[id][hPosEnter][0], hInfo[id][hPosEnter][1], hInfo[id][hPosEnter][2], (strcmp("None", hInfo[id][hOwner], true) == 0 ? 31 : 32), 0, -1, 0, -1, 250.0);
printf("%s",orm_errno(hInfo[id][hORM_ID]) == ERROR_OK ? ("OK") : ("NO_DATA"));
orm_apply_cache(h, id);
TOTALHOUSES++;
}
return printf("\n[Çàãðóçêà äîìîâ] - Çàãðóæåíî <%i> çà <%d ìñ>", TOTALHOUSES, GetTickCount() - time);
}