24.04.2014, 20:05
Quote:
Adress is string so don't use strval for it:
pawn Код:
|
pawn Код:
public HousesLoad()
{
new temp[400], string[400], rows, fields;
cache_get_data(rows, fields, g_Handle);
if(rows)
{
for(new id = 0; id < MAX_HOUSES; id++)
{
cache_get_row(0, 0, temp, g_Handle), HouseInfo[id][hHouseID] = strval(temp);
cache_get_row(0, 1, HouseInfo[id][hAddress], g_Handle, 31);
cache_get_row(0, 2, temp, g_Handle), HouseInfo[id][hPrice] = strval(temp);
cache_get_row(0, 3, temp, g_Handle), HouseInfo[id][hEnterPos][0] = floatstr(temp);
cache_get_row(0, 4, temp, g_Handle), HouseInfo[id][hEnterPos][1] = floatstr(temp);
cache_get_row(0, 5, temp, g_Handle), HouseInfo[id][hEnterPos][2] = floatstr(temp);
cache_get_row(0, 6, temp, g_Handle), HouseInfo[id][hExitPos][0] = floatstr(temp);
cache_get_row(0, 7, temp, g_Handle), HouseInfo[id][hExitPos][1] = floatstr(temp);
cache_get_row(0, 8, temp, g_Handle), HouseInfo[id][hExitPos][2] = floatstr(temp);
HouseInfo[id][hPickup] = CreateDynamicPickup(1273, 23, HouseInfo[id][hEnterPos][0], HouseInfo[id][hEnterPos][1], HouseInfo[id][hEnterPos][2], -1, -1, -1, 100.0);
format(string,sizeof(string),"HouseID: %d\nAddress: %s\nPrice: %d", HouseInfo[id][hHouseID], HouseInfo[id][hAddress], HouseInfo[id][hPrice]);
HouseInfo[id][hText] = CreateDynamic3DTextLabel(string, -1, HouseInfo[id][hEnterPos][0], HouseInfo[id][hEnterPos][1], HouseInfo[id][hEnterPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100);
break;
}
printf("%i houses loaded.", rows); // This shows that two houses have been loaded.
}
return 1;
}
Thanks. Giving me headache been stuck on this for over a week but managed to code more complicated things and get them working