Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Load_Houses() //Chargement des houses
- {
- new rows, fields, string[256];
- cache_get_data(rows, fields);
- if(cache_num_rows() > 0)
- {
- for(new i; i < rows; i++)
- {
- hInfo[i][hSQL] = cache_get_field_content_int(i, "id");
- hInfo[i][hPosX] = cache_get_field_content_float(i, "x");
- hInfo[i][hPosY] = cache_get_field_content_float(i, "y");
- hInfo[i][hPosZ] = cache_get_field_content_float(i, "z");
- hInfo[i][hPrix] = cache_get_field_content_int(i, "prix");
- hInfo[i][hInX] = cache_get_field_content_float(i, "in_x");
- hInfo[i][hInY] = cache_get_field_content_float(i, "in_y");
- hInfo[i][hInZ] = cache_get_field_content_float(i, "in_z");
- hInfo[i][hExterior_Int] = cache_get_field_content_int(i, "exterior_world");
- hInfo[i][hExterior_World] = cache_get_field_content_int(i, "exterior_int");
- hInfo[i][hInterior_Int] = cache_get_field_content_int(i, "interior_world");
- hInfo[i][hInterior_World] = cache_get_field_content_int(i, "interior_int");
- hInfo[i][hOwnerSQL] = cache_get_field_content_int(i, "owner_sql");
- hInfo[i][hPickup] = CreatePickup(1239, 0, hInfo[i][hPosX], hInfo[i][hPosY], hInfo[i][hPosZ], hInfo[i][hExterior_World]);
- if(hInfo[i][hOwnerSQL] > 0)
- {
- format(string, sizeof(string), "Maison (id %d)\nPropriétaire: %s", hInfo[i][hSQL], pInfo[hInfo[i][hOwnerSQL]][pUsername]);
- }
- else
- {
- format(string, sizeof(string), "Maison en vente (id %d)\nPrix: $%d", hInfo[i][hSQL], hInfo[i][hPrix]);
- }
- hInfo[i][hText] = Create3DTextLabel(string, -1, hInfo[i][hPosX], hInfo[i][hPosY], hInfo[i][hPosZ]+0.7, 10.0, hInfo[i][hExterior_World], 0);
- hInfo[i][hExist] = true;
- }
- }
- printf("%d houses trouvés dans la database", rows);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement