Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock LoadBuildings()
- {
- new query[128];
- mysql_format(mysql, query, sizeof(query), "SELECT * FROM `buildings`");
- mysql_tquery(mysql, query, "OnBuildingLoad");
- return 1;
- }
- forward OnBuildingLoad();
- public OnBuildingLoad()
- {
- static row, field;
- cache_get_data(row, field, mysql);
- if(row)
- {
- for(new i = 0; i < row; i++)
- {
- new id = Iter_Free(buildings);
- Iter_Add(buildings, id);
- bInfo[id][bSQLID] = cache_get_field_content_int(i, "ID");
- bInfo[id][bOwnID] = cache_get_field_content_int(i, "own_id");
- cache_get_field_content(i, "type", bInfo[id][bType], mysql, 16);
- cache_get_field_content(i, "name", bInfo[id][bName], mysql, 36);
- bInfo[id][bType] = cache_get_field_content_int(i, "type");
- bInfo[id][bPosX] = cache_get_field_content_float(i, "posX");
- bInfo[id][bPosY] = cache_get_field_content_float(i, "posY");
- bInfo[id][bPosZ] = cache_get_field_content_float(i, "posZ");
- bInfo[id][interior] = cache_get_field_content_int(i, "interior");
- bInfo[id][vw] = cache_get_field_content_int(i, "vw");
- bInfo[id][vwint] = cache_get_field_content_int(i, "exitvw");
- bInfo[id][interiorID] = cache_get_field_content_int(i, "interiorid");
- bInfo[id][bForSale] = cache_get_field_content_int(i, "for_sale");
- bInfo[id][bPrice] = cache_get_field_content_int(i, "price");
- bInfo[id][bLocked] = cache_get_field_content_int(i, "locked");
- bInfo[id][faz] = cache_get_field_content_int(i, "faz");
- bInfo[id][bMoney] = cache_get_field_content_int(i, "money");
- bInfo[id][bEnterPrice] = cache_get_field_content_int(i, "enter_price");
- bInfo[id][bFaction] = cache_get_field_content_int(i, "faz");
- GetCoords2DZone(bInfo[id][bPosX], bInfo[id][bPosY], bInfo[id][bAddress], MAX_ZONE_NAME);
- GetInteriorCoord(id);
- CreateBuildingStuffs(id);
- }
- }
- return 1;
- }
- CreateBuildingStuffs(bid)
- {
- new string[80];
- for(new i = 0; i < 80; i++)
- {
- string[i] = 0;
- }
- if(bInfo[bid][bForSale])
- {
- if(bInfo[bid][bType] == CASA)
- {
- format(string,sizeof(string), "Casa in vendita - %d %s\n(%d$)", bInfo[bid][bSQLID], bInfo[bid][bAddress], bInfo[bid][bPrice]);
- bInfo[bid][pickup] = CreateDynamicPickup(1273, 1, bInfo[bid][bPosX], bInfo[bid][bPosY], bInfo[bid][bPosZ],
- bInfo[bid][vw], bInfo[bid][interior], -1);
- }
- if(bInfo[bid][bType] == BIZ)
- {
- format(string,sizeof(string), "Biz in vendita - %d %s(%d$)", bInfo[bid][bSQLID], bInfo[bid][bAddress], bInfo[bid][bPrice]);
- bInfo[bid][pickup] = CreateDynamicPickup(1272, 1, bInfo[bid][bPosX], bInfo[bid][bPosY], bInfo[bid][bPosZ],
- bInfo[bid][vw], bInfo[bid][interior], -1);
- }
- if(bInfo[bid][bType] == COMPLEX)
- {
- format(string,sizeof(string), "Complex in vendita - %d %s(%d$)", bInfo[bid][bSQLID], bInfo[bid][bAddress], bInfo[bid][bPrice]);
- bInfo[bid][pickup] = CreateDynamicPickup(1314, 1, bInfo[bid][bPosX], bInfo[bid][bPosY], bInfo[bid][bPosZ],
- bInfo[bid][vw], bInfo[bid][interior], -1);
- }
- }
- else if(!bInfo[bid][bForSale])
- {
- if(bInfo[bid][bType] == CASA)
- {
- format(string,sizeof(string), "%d %s", bInfo[bid][bSQLID], bInfo[bid][bAddress]);
- bInfo[bid][CP] = CreateDynamicCP(bInfo[bid][bPosX], bInfo[bid][bPosY], bInfo[bid][bPosZ]-0.3, 2.2000,
- bInfo[bid][vw], bInfo[bid][interior], -1, 1.5);
- }
- if(bInfo[bid][bType] == BIZ)
- {
- format(string,sizeof(string), "%s", bInfo[bid][bName]);
- bInfo[bid][pickup] = CreateDynamicPickup(1272, 1, bInfo[bid][bPosX], bInfo[bid][bPosY], bInfo[bid][bPosZ],
- bInfo[bid][vw], bInfo[bid][interior], -1);
- }
- if(bInfo[bid][bType] == COMPLEX)
- {
- format(string,sizeof(string), "%s", bInfo[bid][bName]);
- bInfo[bid][pickup] = CreateDynamicPickup(1314, 1, bInfo[bid][bPosX], bInfo[bid][bPosY], bInfo[bid][bPosZ],
- bInfo[bid][vw], bInfo[bid][interior], -1);
- }
- }
- bInfo[bid][label] = CreateDynamic3DTextLabel(string, COLOR_WHITE, bInfo[bid][bPosX], bInfo[bid][bPosY], bInfo[bid][bPosZ]+0.5,
- 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, bInfo[bid][vw], bInfo[bid][interior], -1);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement