Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward loadHouses();
- public loadHouses() {
- cache_get_data(rows, fields);
- if(rows) {
- new id, pickup;
- for(new i; i < rows; i++) {
- id = cache_get_field_content_int(i, "id");
- hInfo[id][hID] = id;
- cache_get_field_content(i, "Name", hInfo[id][hName], handle, 32);
- cache_get_field_content(i, "Price", hInfo[id][hPrice], handle, 15);
- cache_get_field_content(i, "Description", hInfo[id][hDescription], handle, 32);
- cache_get_field_content(i, "Owner", hInfo[id][hOwner], handle, 32);
- hInfo[id][heX] = cache_get_field_content_float(i, "eX");
- hInfo[id][heY] = cache_get_field_content_float(i, "eY");
- hInfo[id][heZ] = cache_get_field_content_float(i, "eZ");
- hInfo[id][hiX] = cache_get_field_content_float(i, "iX");
- hInfo[id][hiY] = cache_get_field_content_float(i, "iY");
- hInfo[id][hiZ] = cache_get_field_content_float(i, "iZ");
- hInfo[id][hInterior] = cache_get_field_content_int(i, "Interior");
- hInfo[id][hSale] = cache_get_field_content_int(i, "Sale");
- hInfo[id][hDoor] = cache_get_field_content_int(i, "Door");
- format(gMsg, 256, "House: %d\nOwner: %s\nDescription: %s\n", hInfo[id][hID], hInfo[id][hOwner], hInfo[id][hDescription]);
- if(hInfo[id][hSale] == 1) {
- pickup = 1273;
- }
- else {
- pickup = 1272;
- }
- hInfo[id][hPickup] = CreateDynamicPickup(pickup, 1, hInfo[id][heX], hInfo[id][heY], hInfo[id][heZ], -1, -1, -1, 20.0);
- hInfo[id][hLabel] = CreateDynamic3DTextLabel(gMsg, COLOR_YELLOW, hInfo[id][heX], hInfo[id][heY], hInfo[id][heZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
- }
- }
- else printf("No houses.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement