Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.73 KB | None | 0 0
  1. function OnPropTextdrawUpdate(update, h)
  2. {
  3. new i = h;
  4. new PropertyString[256];
  5. if(update == 1)
  6. {
  7. new type[10],locked[20];
  8. if(HouseInfo[h][hInteriorType] == 0) format(type, sizeof(type),"Small");
  9. if(HouseInfo[h][hInteriorType] == 1) format(type, sizeof(type),"Medium");
  10. if(HouseInfo[h][hInteriorType] == 2) format(type, sizeof(type),"Big");
  11. if(HouseInfo[h][hLock] == 1) format(locked, sizeof(locked), "\n(locked)");
  12. HouseIcon[h] = CreateDynamicMapIcon(HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 31, -1, 0, 0, -1, 50.0);
  13. if(HouseInfo[h][hOwned] == 0)
  14. {
  15. DestroyDynamic3DTextLabel(HouseLabel[h]);
  16. format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {BA3434}%d \n{BA3434}%s \n{FFFFFF}Size: {BA3434}%s \n{FFFFFF}Price: {BA3434}$%s (/buyhouse) \n{FFFFFF}Level: {BA3434}%d %s",h,HouseInfo[h][hDiscription],type,FormatNumber(HouseInfo[h][hValue]),HouseInfo[h][hLevel],locked);
  17. HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0xFFFFFFFF, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  18. DestroyDynamicPickup(HousePickup[h]);
  19. HousePickup[h] = CreateDynamicPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  20. }
  21. else if(HouseInfo[h][hOwned] == 1)
  22. {
  23. new tenants=0,query[256],selltext[64];
  24. format(query, sizeof(query), "SELECT * FROM `users` WHERE `Rented` = '%d' AND `Status`='1'", h);
  25. new Cache: membresult = mysql_query(SQL, query);
  26. for(new ii, j = cache_get_row_count (); ii != j; ++ii)
  27. {
  28. tenants++;
  29. }
  30. cache_delete(membresult);
  31. if(HouseInfo[h][hPrice] > 0)
  32. {
  33. format(selltext, sizeof(selltext),"\n{FFFFFF}Price: {BA3434}$%s (/buyhouse)",FormatNumber(HouseInfo[h][hPrice]));
  34. }
  35. if(HouseInfo[h][hRentabil] == 1)
  36. {
  37. DestroyDynamic3DTextLabel(HouseLabel[h]);
  38. format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {BA3434}%d \n{BA3434}%s \n{FFFFFF}Owner: {BA3434}%s \n{FFFFFF}Tenants: {BA3434}%d \n{FFFFFF}Size: {BA3434}%s \n{FFFFFF}Rent: {BA3434}$%d (/rentroom) %s %s",h,HouseInfo[h][hDiscription],HouseInfo[h][hOwner],tenants,type,HouseInfo[h][hRent],selltext,locked);
  39. HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0xFFFFFFFF, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  40. DestroyDynamicPickup(HousePickup[h]);
  41. HousePickup[h] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  42. }
  43. else
  44. {
  45. DestroyDynamic3DTextLabel(HouseLabel[h]);
  46. format(PropertyString, sizeof(PropertyString),"{FFFFFF}House {BA3434}%d \n{BA3434}%s \n{FFFFFF}Owner: {BA3434}%s \n{FFFFFF}Tenants: {BA3434}%d \n{FFFFFF}Size: {BA3434}%s %s %s",h,HouseInfo[h][hDiscription],HouseInfo[h][hOwner], tenants, type, selltext, locked);
  47. HouseLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0xFFFFFFFF, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  48. DestroyDynamicPickup(HousePickup[h]);
  49. HousePickup[h] = CreateDynamicPickup(1272, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  50. }
  51. }
  52. }
  53. else if(update == 2)
  54. {
  55. if(BizzInfo[h][bOwned] == 0)
  56. {
  57. DestroyDynamic3DTextLabel(BizzLabel[h]);
  58. if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{52A3F2}%s \n{EEEEEE}Business {52A3F2}#%d \n {EEEEEE}Price: {52A3F2}$%s (/buybusiness) \n{EEEEEE}Level: {52A3F2}%d",BizzInfo[h][bMessage],h,FormatNumber(BizzInfo[h][bBuyPrice]),BizzInfo[h][bLevelNeeded]);
  59. else format(PropertyString, sizeof(PropertyString),"{52A3F2}%s \n{EEEEEE}Business {52A3F2}#%d \n {EEEEEE}Price: {52A3F2}$%s (/buybusiness) \n{EEEEEE}Level: {52A3F2}%d \n(locked)",BizzInfo[h][bMessage],h,FormatNumber(BizzInfo[h][bBuyPrice]),BizzInfo[h][bLevelNeeded]);
  60. BizzLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0xFFFFFFFF, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  61. DestroyDynamicPickup(BizzPickup[h]);
  62. BizzPickup[i] = CreateDynamicPickup(19134, 1, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
  63. }
  64. else if(BizzInfo[h][bOwned] == 1)
  65. {
  66. DestroyDynamic3DTextLabel(BizzLabel[h]);
  67. if(BizzInfo[h][bPrice] > 0)
  68. {
  69. if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{52A3F2}%s \n{EEEEEE}Business {52A3F2}#%d \n{EEEEEE}Owner: {52A3F2}%s \n{EEEEEE}Fee: {52A3F2}$%s \n{EEEEEE}Price: {52A3F2}$%s (/buybusiness)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]), FormatNumber(BizzInfo[h][bPrice]));
  70. else format(PropertyString, sizeof(PropertyString),"{52A3F2}%s \n{EEEEEE}Business {52A3F2}#%d \n{EEEEEE}Owner: {52A3F2}%s \n{EEEEEE}Fee: {52A3F2}$%s \n{EEEEEE}Price: {52A3F2}$%s (/buybusiness) \n(locked)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]), FormatNumber(BizzInfo[h][bPrice]));
  71. }
  72. else
  73. {
  74. if(BizzInfo[h][bLocked] == 0) format(PropertyString, sizeof(PropertyString),"{52A3F2}%s \n{EEEEEE}Business {52A3F2}#%d \n{EEEEEE}Owner: {52A3F2}%s \n{EEEEEE}Fee: {52A3F2}$%s",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]));
  75. else format(PropertyString, sizeof(PropertyString),"{52A3F2}%s \n{EEEEEE}Business {52A3F2}#%d \n{EEEEEE}Owner: {52A3F2}%s \n{EEEEEE}Fee: {52A3F2}$%s \n(locked)",BizzInfo[h][bMessage],h,BizzInfo[h][bOwner],FormatNumber(BizzInfo[h][bEntranceCost]));
  76. }
  77. BizzLabel[h] = CreateDynamic3DTextLabel(PropertyString, 0xFFFFFFFF, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
  78. DestroyDynamicPickup(BizzPickup[h]);
  79. BizzPickup[i] = CreateDynamicPickup(19134, 1, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]);
  80. }
  81. }
  82. return 1;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement