09.04.2019, 20:59
Code:
orward OnPropTextdrawUpdate(update, h); public OnPropTextdrawUpdate(update, h) { new PropertyString[256]; if(update == 1) { new type[10],locked[20]; if(HouseInfo[h][hInteriorType] == 0) format(type, sizeof(type),"Small"); if(HouseInfo[h][hInteriorType] == 1) format(type, sizeof(type),"Medium"); if(HouseInfo[h][hInteriorType] == 2) format(type, sizeof(type),"Big"); if(HouseInfo[h][hLock] == 1) format(locked, sizeof(locked), "\n(locked)"); if(HouseInfo[h][hOwned] == 0) { DestroyDynamic3DTextLabel(HouseLabel[h]); format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}%s \n{FFFFFF}Size: {B40404}%s \n{FFFFFF}Price: {B40404}$%s (/buyhouse) \n{FFFFFF}Level: {B40404}%d %s",h,HouseInfo[h][hDiscription],type,FormatNumber(HouseInfo[h][hValue]),HouseInfo[h][hLevel],locked); HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); DestroyDynamicPickup(HousePickup[h]); HousePickup[h] = CreateDynamicPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]); } else if(HouseInfo[h][hOwned] == 1) { new tenants=0,query[256],selltext[64]; format(query, sizeof(query), "SELECT * FROM `users` WHERE `Rented` = '%d' AND `Status`='1'", h); new Cache: membresult = mysql_query(SQL, query); for(new i, j = cache_get_row_count (); i != j; ++i) { tenants++; } cache_delete(membresult); if(HouseInfo[h][hPrice] > 0) { format(selltext, sizeof(selltext),"\n{FFFFFF}Price: {B40404}$%s (/buyhouse)",FormatNumber(HouseInfo[h][hPrice])); } if(HouseInfo[h][hRentabil] == 1) { DestroyDynamic3DTextLabel(HouseLabel[h]); format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}%s \n{FFFFFF}Owner: {B40404}%s \n{FFFFFF}Tenants: {B40404}%d \n{FFFFFF}Size: {B40404}%s \n{FFFFFF}Rent: {B40404}$%d (/rentroom) %s %s",h,HouseInfo[h][hDiscription],HouseInfo[h][hOwner],tenants,type,HouseInfo[h][hRent],selltext,locked); HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); DestroyDynamicPickup(HousePickup[h]); HousePickup[h] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]); } else { DestroyDynamic3DTextLabel(HouseLabel[h]); format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {B40404}%d \n{B40404}%s \n{FFFFFF}Owner: {B40404}%s \n{FFFFFF}Tenants: {B40404}%d \n{FFFFFF}Size: {B40404}%s %s %s",h,HouseInfo[h][hDiscription],HouseInfo[h][hOwner], tenants, type, selltext, locked); HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x9C0000F7, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); DestroyDynamicPickup(HousePickup[h]); HousePickup[h] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]); } } } else if(update == 2) { if(BizzInfo[h][bOwned] == 0) { DestroyDynamic3DTextLabel(BizzLabel[h]); if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n {EEEEEE}Price: {0068CF}$%s (/buybusiness) \n{EEEEEE}Level: {0068CF}%d",BizzInfo[h][bMessage],h,FormatNumber(BizzInfo[h][bBuyPrice]),BizzInfo[h][bLevelNeeded]); else format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n {EEEEEE}Price: {0068CF}$%s (/buybusiness) \n{EEEEEE}Level: {0068CF}%d \n(locked)",BizzInfo[h][bMessage],h,FormatNumber(BizzInfo[h][bBuyPrice]),BizzInfo[h][bLevelNeeded]); BizzLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x0053CFD1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); } else if(BizzInfo[h][bOwned] == 1) { DestroyDynamic3DTextLabel(BizzLabel[h]); if(BizzInfo[h][bPrice] > 0) { if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s \n{EEEEEE}Price: {0068CF}$%s (/buybusiness)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]), FormatNumber(BizzInfo[h][bPrice])); else format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s \n{EEEEEE}Price: {0068CF}$%s (/buybusiness) \n(locked)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]), FormatNumber(BizzInfo[h][bPrice])); } else { if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost])); else format(PropertyString, sizeof(PropertyString),"{0068CF}%s \n{EEEEEE}Business {0068CF}#%d \n{EEEEEE}Owner: {0068CF}%s \n{EEEEEE}Fee: {0068CF}$%s \n(locked)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost])); } BizzLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0x0053CFD1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); } } return 1; }