Guest User

Untitled

a guest
Mar 2nd, 2011
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 180.21 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf2> // Credits to Y_Less
  3. #include <YSI\y_ini> // Credits to Y_Less
  4. #include <ZCMD> // Credits to Zeex
  5. #include <streamer> // Credits to Incognito
  6. #include <foreach> // Credits to Y_Less
  7.  
  8. #define INFORMATION_HEADER "{F6F6F6}GarHouse {00BC00}v2.0 {F6F6F6}by {00BC00}[03]Garsino"
  9. #define LABELTEXT1 "House Name: {F6F6F6}%s\n{00BC00}House Owner: {F6F6F6}No Owner\n{00BC00}House Value: {F6F6F6}$%d\n{00BC00}For Sale: {F6F6F6}No\n{00BC00}House Privacy: {F6F6F6}Closed\n{00BC00}House ID: {F6F6F6}%d"
  10. #define LABELTEXT2 "House Name: {F6F6F6}%s\n{00BC00}House Owner: {F6F6F6}%s\n{00BC00}House Value: {F6F6F6}$%d\n{00BC00}For Sale: {F6F6F6}%s\n{00BC00}House Privacy: {F6F6F6}%s\n{00BC00}House ID: {F6F6F6}%d"
  11.  
  12. //==============================================================================
  13. // Macros
  14. //==============================================================================
  15. new CMDSString[1000], IsInHouse[MAX_PLAYERS char];
  16. #define YesNo(%0) ((%0) == (1)) ? ("Yes") : ("No")
  17. #define Answer(%0,%1,%2) (%0) == (1) ? (%1) : (%2)
  18. #define IsPlayerInHouse(%0,%1) ((GetPVarInt(%0, "LastHouseCP") == (%1)) && (IsInHouse{%0} == (1))) ? (1) : (0)
  19. #define ShowInfoBox(%0,%1,%2) do{CMDSString = ""; format(CMDSString, 1000, %1, %2); ShowPlayerDialog(%0, HOUSEMENU-1, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, CMDSString, "Close", "");}while(FALSE)
  20. #define GameTextEx(%0,%1,%2,%3,%4) do{CMDSString = ""; format(CMDSString, 1000, %3, %4); GameTextForPlayer(%0, CMDSString, %1, %2);}while(FALSE)
  21. #define Loop(%0,%1,%2) for(new %0 = %2; %0 < %1; %0++)
  22. #define function%0(%1) forward %0(%1); public %0(%1)
  23. #define TYPE_OUT (0)
  24. #define TYPE_INT (1)
  25. //==============================================================================
  26. // Colours
  27. //==============================================================================
  28. #define COLOUR_INFO 0x00CC33FF
  29. #define COLOUR_SYSTEM 0xFF0000FF
  30. #define COLOUR_YELLOW 0xFFFF2AFF
  31. #define COLOUR_GREEN 0x00BC00FF
  32. #define COLOUR_DIALOG 0xF6F6F6AA
  33. //==============================================================================
  34. #define DC_SAMP "{F6F6F6}"
  35. #define DC_DIALOG "{F6F6F6}"
  36. #define DC_ERROR "{FF0000}"
  37. #define DC_ADMIN "{CC00CC}"
  38. #define DC_INFO "{00BC00}"
  39. //==============================================================================
  40. // Configuration
  41. //==============================================================================
  42. #define MAX_HOUSES 100 // Max houses created
  43. #define MAX_HOUSE_INTERIORS 15 // Max house interiors created
  44. #define MAX_HOUSES_OWNED 3 // Max houses owned per player
  45. #define HOUSEMENU 21700 // Dialog ID
  46. #define FILEPATH "/GarHouse/Houses/%d.ini"
  47. #define HINT_FILEPATH "/GarHouse/Interiors/%d.ini"
  48. #define USERPATH "/GarHouse/Users/%s.ini"
  49. //------------------------------------------------------------------------------
  50. #define GH_USE_MAPICONS true // true = use mapicons | false = do not use mapicons
  51. #define GH_USE_CPS true // true = use checkpoints | false = use pickups
  52. #define GH_HINTERIOR_UPGRADE true // true = allow players to upgrade their house interior | false = do not allow players to upgrade their house interior
  53. #define GH_USE_HOUSESTORAGE true // true = allow players to use the house storage | false = do not allow players to use the house storage
  54. #define GH_HOUSECARS true // true = enable house cars | false = disable house cars
  55. #define SPAWN_IN_HOUSE true // true = players will spawn in their house on their first spawn | false = players will not spawn in their house on their first spawn
  56. #define CASE_SENSETIVE true // true = ignore case sensetive in strcmp | false = do not ignore case sensetive in strcmp
  57. #define GH_ALLOW_BREAKIN true // true = allow players to breakin to houses | false = do not allow players to breakin to houses
  58. #define GH_GIVE_WANTEDLEVEL true // true = increase the players wanted level when they either attempt to breakin/rob a house or they succeed in doing so | false = do not increase the players wanted level when they either attempt to breakin/rob a house or they succeed in doing so
  59. #define GH_ALLOW_HOUSEROBBERY false // true = allow players to rob houses | false = do not allow players to rob houses
  60. #define GH_SAVE_ADMINWEPS false // true = save admin weapons (f.ex: minigun, grenades, RPG) | false = do not save admin weapons (f.ex: minigun, grenades, RPG)
  61. #define GH_USE_WEAPONSTORAGE false // true = allow players to store weapons in their house | false = do not allow players to store weapons in their house
  62. #define GH_ALLOW_HOUSETELEPORT false // true = allow players to teleport to their house using /myhouses | false = do not allow players to teleport to their house using /myhouses
  63. //------------------------------------------------------------------------------
  64. #define HOUSEFILE_LENGTH 30
  65. #define INTERIORFILE_LENGTH 30
  66. #define MIN_HOUSE_VALUE 0 // Min house value of a house (ofc prices will change when a house is bought/sold nearby)
  67. #define MAX_HOUSE_VALUE 1000000 // Max house value of a house (ofc prices will change when a house is bought/sold nearby)
  68. #define MIN_HINT_VALUE 10000 // Min house interior value
  69. #define MAX_HINT_VALUE 50000000 // Max house interior value
  70. #define HOUSE_ROBBERY_PERCENT 25 // How many percent of the cash in the house storage will be robbed?
  71. #define MAX_MONEY_ROBBED 500000 // Max money you can rob from a house.
  72. #define HSPAWN_TIMER_RATE 1000 // After how long will the timer call the spawn in house function? (in ms)
  73. #define MICON_VD 50.0 // Map icon visible range (drawdistance).
  74. #define TEXTLABEL_DISTANCE 25.0 // 3D text visible range (drawdistance)
  75. #define TEXTLABEL_TESTLOS 1 // 1 makes the 3D text label visible trough walls.
  76. #define CP_DRAWDISTANCE 25.0 // checkpoint visible range (drawdistance)
  77. #define DEFAULT_H_INTERIOR 0 // Default house interior when creating a house
  78. #define HCAR_COLOUR1 -1 // The first colour of the housecar
  79. #define HCAR_COLOUR2 -1 // The second colour of the housecar
  80. #define HCAR_RESPAWN 60 // The respawn delay of the house car (in seconds)
  81. #define HCAR_RANGE 10.0 // The range to check for nearby vehicles when saving the house car.
  82. #define PICKUP_MODEL_OUT 1273 // Pickup model ID which shows up OUTSIDE the house.
  83. #define PICKUP_MODEL_INT 1272 // Pickup model ID which shows up INSIDE the house.
  84. #define PICKUP_TYPE 1 // The pickup type if you decide to not use checkpoints
  85. #define MAX_VISIT_TIME 1 // The max time the player can be visiting in (In Minutes).
  86. #define TIME_BETWEEN_VISITS 2 // The time the player have to wait before previewing a new house interior (In minutes).
  87. #define TIME_BETWEEN_BREAKINS 5 // The time the player have to wait before attempting to breakin to a house again (In minutes).
  88. #define TIME_BETWEEN_ROBBERIES 10 // The time the player have to wait before attempting to rob a house again (In minutes).
  89. #define HOUSE_SELLING_PROCENT 75 // The amount of the house value the player will get when the house is sold.
  90. #define HOUSE_SELLING_PROCENT2 6.5 // The total percentage the nearby houses will go up/down by when a house is sold/bought nearby.
  91. #define RANGE_BETWEEN_HOUSES 200 // The range used when increasing/decreasing the value of nearby houses when a house is bought/sold (set to 0 to disable)
  92. #define MAX_HOUSE_NAME 35 // Max length of a house name
  93. #define MIN_HOUSE_NAME 4 // Min length of a house name
  94. #define MAX_HINT_NAME 35 // Max length of a house interior name
  95. #define MIN_HINT_NAME 4 // Min length of a house interior name
  96. #define MAX_HOUSE_PASSWORD 35 // Max length of a house password
  97. #define MIN_HOUSE_PASSWORD 4 // Min length of a house password
  98. #define MAX_ZONE_NAME 60 // Max length of a zone name
  99. #define MIN_ROB_TIME 30 // The minimum amount of time the player have to be in the house to be able to rob it (In seconds)
  100. #define MAX_ROB_TIME 60 // The maximum amount of time the player have to be in the house to be able to rob it (In seconds)
  101. #define HUPGRADE_ALARM 10000 // How much the player should pay for the house alarm upgrade.
  102. #define HUPGRADE_CAMERA 25000 // How much the player should pay for the security camera upgrade.
  103. #define HUPGRADE_DOG 35000 // How much the player should pay for the security dog upgrade.
  104. #define HUPGRADE_UPGRADED_HLOCK 40000 // How much the player should pay for the doorlock upgrade.
  105. #define HBREAKIN_WL 1 // How much should the players wanted level increase by when they fail/succeed at breaking into a house (if the house has a house alarm/security camera).
  106. #define HROBBERY_WL 3 // How much should the players wanted level increase by when they fail/succeed at robbing a house (if the house has a house alarm/security camera).
  107. #define GH_MAX_WANTED_LEVEL 6 // What is the max wanted level a player can get?
  108. #define SECURITYDOG_HEALTHLOSS 25.00 // How much health should the player lose after each bit?
  109. #define SECURITYDOG_BITS 3 // How many times will the dog bite the player during a breakin/robbery?
  110. #define INVALID_HOWNER_NAME "INVALID_PLAYER_ID" // The "name" of the house owner when there is no owner of the house
  111. #define DEFAULT_HOUSE_NAME "House For Sale!" // The default name when a house is created/sold
  112. //------------------------------------------------------------------------------
  113. new Iterator:Houses<MAX_HOUSES>, Text3D:HouseLabel[MAX_HOUSES], Float:X, Float:Y, Float:Z, Float:Angle;
  114. #if GH_USE_CPS == true
  115. new HouseCPOut[MAX_HOUSES], HouseCPInt[MAX_HOUSES];
  116. #else
  117. new HousePickupOut[MAX_HOUSES], HousePickupInt[MAX_HOUSES];
  118. #endif
  119. #if GH_USE_MAPICONS == true
  120. new HouseMIcon[MAX_HOUSES];
  121. #endif
  122. #if GH_HOUSECARS == true
  123. new HCar[MAX_HOUSES];
  124. #endif
  125. enum Data
  126. {
  127. HousePassword,
  128. HouseOwner[MAX_PLAYER_NAME],
  129. HouseName[MAX_HOUSE_NAME],
  130. HouseLocation[MAX_ZONE_NAME],
  131. Float:SpawnOutAngle,
  132. SpawnInterior,
  133. SpawnWorld,
  134. Float:CPOutX,
  135. Float:CPOutY,
  136. Float:CPOutZ,
  137. Float:SpawnOutX,
  138. Float:SpawnOutY,
  139. Float:SpawnOutZ,
  140. HouseValue,
  141. HouseStorage,
  142. HouseInterior,
  143. HouseCar,
  144. HouseCarModel,
  145. HouseCarWorld,
  146. HouseCarInterior,
  147. Float:HouseCarPosX,
  148. Float:HouseCarPosY,
  149. Float:HouseCarPosZ,
  150. Float:HouseCarAngle,
  151. QuitInHouse,
  152. Weapon[14],
  153. Ammo[14],
  154. ForSale,
  155. ForSalePrice,
  156. HousePrivacy,
  157. HouseAlarm,
  158. HouseCamera,
  159. HouseDog,
  160. UpgradedLock
  161. }
  162. enum hIntData
  163. {
  164. IntName[30],
  165. Float:IntSpawnX,
  166. Float:IntSpawnY,
  167. Float:IntSpawnZ,
  168. Float:IntSpawnAngle,
  169. Float:IntCPX,
  170. Float:IntCPY,
  171. Float:IntCPZ,
  172. IntInterior,
  173. IntValue
  174. }
  175. new hInfo[MAX_HOUSES][Data], hIntInfo[MAX_HOUSE_INTERIORS][hIntData];
  176. new CurrentID;
  177. //==============================================================================
  178. // Translation / SendClientMessage Messages
  179. //==============================================================================
  180. /*
  181. - Below you will find a list of messages.
  182. - You can translate these messages to whatever language you want.
  183. - When updating to a new version, simply replace the messages with the ones you translated.
  184. - But read the note where it says what version the messages below were added for.
  185. - There might have been some more messages added after this version of GarHouse (v2.0),
  186. - so do not replace all of the messages without looking carefully if there is any new ones.
  187. - And be careful when editing messages containing placeholders (%s, %d, %i, etc),
  188. - if you change the position of these it will screw up eventually.
  189. - and do not remove or add any more placeholders if you do NOT know what you're doing.
  190. - Oh and one more thing, I did not translate the dialogs wich uses list items. You will have to do that yourself.
  191.  
  192.  
  193. Thanks,
  194. [03]Garsino.
  195. */
  196. /*
  197. ----------------------------------
  198. VERSION 2.0 NOTES - IMPORTANT!
  199. ----------------------------------
  200. All messages needs to be replaced
  201. */
  202. //##############################################################################
  203. // Messages added in v2.0
  204. //##############################################################################
  205. #define E_NO_HOUSES_OWNED "{F6F6F6}You do not own any houses."
  206. #define I_HMENU "{F6F6F6}Type /housemenu to access the house menu."
  207. #define E_H_ALREADY_OWNED "{F6F6F6}This house is already owned by someone else."
  208. #define E_INVALID_HPASS_LENGTH "{F6F6F6}Invalid house password length"
  209. #define E_INVALID_HPASS "{F6F6F6}Invalid house password. You may not use this house password."
  210. #define E_INVALID_HPASS_CHARS "{F6F6F6}Your house password contains illegal characters ({00BC00}percentage sign {F6F6F6}or {00BC00}~{F6F6F6})."
  211. #define E_INVALID_HNAME_LENGTH "{F6F6F6}Invalid house name length."
  212. #define E_INVALID_HNAME_CHARS "{F6F6F6}Your house name contains illegal characters ({00BC00}percentage sign {F6F6F6}or {00BC00}~{F6F6F6})."
  213. #define I_HPASS_NO_CHANGE "{F6F6F6}Your house password remains the same."
  214. #define I_HPASS_REMOVED "{F6F6F6}The house password for this house has been removed."
  215. #define E_NOT_ENOUGH_PMONEY "{F6F6F6}You do not have that much money."
  216. #define E_INVALID_AMOUNT "{F6F6F6}Invalid amount."
  217. #define E_HSTORAGE_L_REACHED "{F6F6F6}You can not deposit this much money into your house storage. It can only hold up to {00BC00}$25,000,000{F6F6F6}."
  218. #define E_NOT_ENOUGH_HSMONEY "{F6F6F6}You do not have that much money in your house storage."
  219. #define E_NO_WEAPONS "{F6F6F6}You do not have any weapons to store."
  220. #define E_NO_HS_WEAPONS "{F6F6F6}You do not have any weapons in your house storage."
  221. #define E_INVALID_HPASS_CHARS2 "{F6F6F6}The entered house password contains illegal characters ({00BC00}percentage sign {F6F6F6}or {00BC00}~{F6F6F6})."
  222. #define E_C_ACCESS_SE_HM "{F6F6F6}You can not access someone elses house menu."
  223. #define E_NOT_IN_HOUSE "{F6F6F6}You need to be in a house to use this command."
  224. #define E_NOT_HOWNER "{F6F6F6}You need to be the owner of a house to use this command."
  225. #define E_HCAR_NOT_IN_VEH "{F6F6F6}You need to be in a vehicle to add a house car."
  226. #define E_INVALID_HID "{F6F6F6}Invalid house ID. This house ID does not exist."
  227. #define E_NO_HCAR "{F6F6F6}This house ID does not have a house car. Unable to delete."
  228. #define E_H_A_F_SALE "{F6F6F6}This house is already for sale. You can not sell it."
  229. #define E_ALREADY_HAVE_HINTERIOR "{F6F6F6}You already have this house interior."
  230. #define E_HINT_WAIT_BEFORE_VISITING "{F6F6F6}Please wait before visiting a house interior again."
  231. #define I_WRONG_HPASS1 "{F6F6F6}You have failed to enter {00BC00}%s's {F6F6F6}house using the password {00BC00}%s{F6F6F6}."
  232. #define I_WRONG_HPASS2 "{00BC00}%s (%d) {F6F6F6}has attempted to enter your house using the password {00BC00}%s{F6F6F6}."
  233. #define I_CORRECT_HPASS1 "{F6F6F6}You have successfully entered {00BC00}%s's {F6F6F6}house using the password {00BC00}%s{F6F6F6}."
  234. #define I_CORRECT_HPASS2 "{00BC00}%s (%d) {F6F6F6}has successfully entered your house using the password {00BC00}%s{F6F6F6}!"
  235. #define E_TOO_MANY_HOUSES "{F6F6F6}Sorry, but there are already {00BC00}%d {F6F6F6}houses created.\nDelete one of the current ones or increase the limit in the script."
  236. #define I_H_CREATED "{F6F6F6}House ID {00BC00}%d {F6F6F6}created..."
  237. #define I_HCAR_EXIST_ALREADY "{F6F6F6}House ID %d {F6F6F6}already have a house car. Overwriting current one."
  238. #define I_HCAR_CREATED "{F6F6F6}House car for house ID {00BC00}%d {F6F6F6}created..."
  239. #define I_H_DESTROYED "{F6F6F6}House ID {00BC00}%d {F6F6F6}destroyed..."
  240. #define I_HCAR_REMOVED "{F6F6F6}House car for house ID {00BC00}%d {F6F6F6}removed..."
  241. #define I_ALLH_DESTROYED "{F6F6F6}All houses removed. ({00BC00}%d {F6F6F6}in total)"
  242. #define I_ALLHCAR_REMOVED "{F6F6F6}All house cars removed. ({00BC00}%d {F6F6F6}in total)"
  243. #define I_HSPAWN_CHANGED "{F6F6F6}You have changed the spawnposition and angle for house ID {00BC00}%d{F6F6F6}."
  244. #define I_TELEPORT_MSG "{F6F6F6}You have teleported to house ID {00BC00}%d{F6F6F6}."
  245. #define I_H_SOLD "{F6F6F6}You have sold house ID {00BC00}%d{F6F6F6}..."
  246. #define I_ALLH_SOLD "{F6F6F6}All houses on the server has been sold. ({00BC00}%d {F6F6F6}in total)"
  247. #define I_H_PRICE_CHANGED "{F6F6F6}The value for house ID {00BC00}%d has been changed to {00BC00}$%d{F6F6F6}."
  248. #define I_ALLH_PRICE_CHANGED "{F6F6F6}You have changed the value of all houses on the server to {00BC00}$%d. ({00BC00}%d {F6F6F6}in total)"
  249. #define I_HINT_VISIT_OVER "{F6F6F6}Your visiting time is over.\nDo you want to buy the house interior {00BC00}%s {F6F6F6}for {00BC00}$%d{F6F6F6}?"
  250. #define E_INVALID_HCAR_MODEL "{F6F6F6}Invalid car model. Accepted car models are between {00BC00}400 {F6F6F6}and {00BC00}612."
  251. #define I_HCAR_CHANGED "{F6F6F6}Car model for house ID {00BC00}%d {F6F6F6}changed to {00BC00}%d."
  252. #define HMENU_SELL_HOUSE2 "{F6F6F6}Type in how much you want to sell your house for below:"
  253. #define HMENU_CANCEL_HOUSE_SALE "{F6F6F6}Your house is no longer for sale."
  254. #define HMENU_HSALE_CANCEL "{F6F6F6}Click {00BC00}\"Remove\" {F6F6F6}to cancel the house sale for this house."
  255. #define E_H_NOT_FOR_SALE "{F6F6F6}This house is not for sale."
  256. #define E_INVALID_HSELL_AMOUNT "{F6F6F6}Invalid amount. The price you want to sell your house for can not be higher than {00BC00}$"#MAX_HOUSE_VALUE" {F6F6F6}or lower than {00BC00}$"#MIN_HOUSE_VALUE"{F6F6F6}."
  257. #define I_H_SET_FOR_SALE "{F6F6F6}You have successfully set your house {00BC00}%s {F6F6F6}for sale for {00BC00}$%d{F6F6F6}."
  258. #define HSELL_BUY_DIALOG "{00BC00}Current House Owner: {F6F6F6}%s\n{00BC00}Current House Name: {F6F6F6}%s\n\nAre You Sure You Want To Buy This House For {00BC00}$%d{F6F6F6}?"
  259. #define HSELLER_CONNECTED_MSG1 "{F6F6F6}Your house {00BC00}%s {F6F6F6}has been sold to {00BC00}%s (%d){F6F6F6}.\n"
  260. #define HSELLER_CONNECTED_MSG2 "{00BC00}You receive: {F6F6F6}$%d\n{00BC00}House Storage: {F6F6F6}$%d\n{00BC00}House Price: {F6F6F6}$%d"
  261. #define HSELLER_OFFLINE_MSG1 "{F6F6F6}Your house {00BC00}%s {F6F6F6}has been sold to {00BC00}%s {F6F6F6}while you were offline.\n"
  262. #define HSELLER_OFFLINE_MSG2 "{00BC00}You receive: {F6F6F6}$%d\n{00BC00}House Storage: {F6F6F6}$%d\n{00BC00}House Price: {F6F6F6}$%d"
  263. #define E_NOT_HOUSECAR_OWNER "{F6F6F6}You can not drive this vehicle as it belongs to the owner of house ID {F6F6F6}%d which is {F6F6F6}%s."
  264. #define I_HOUSECAR_OWNER "{F6F6F6}Welcome to your vehicle, {00BC00}%s{F6F6F6}! This vehicle belongs to your house (ID {00BC00}%d{F6F6F6}) so therefore only you can drive it."
  265. #define I_TO_PLAYERS_HSOLD "{F6F6F6}This house has been sold.\nYou have been automaticly kicked out from the house."
  266. #define E_INVALID_HINT "{F6F6F6}Invalid house interior. Accepted house interiors are between {00BC00}0 {F6F6F6}and {00BC00}"#MAX_HOUSE_INTERIORS"{F6F6F6}."
  267. #define E_CMD_USAGE_CHANGEHINTSPAWN "Usage:{F6F6F6} /changehintspawn (house interior)"
  268. #define E_CMD_USAGE_CREATEHINT "Usage:{F6F6F6} /createhint (value) (name)"
  269. #define E_CMD_USAGE_REMOVEHINT "Usage:{F6F6F6} /removehint (house interior)"
  270. #define E_CMD_USAGE_CREATEHOUSE "Usage:{F6F6F6} /createhouse (house value) (optional: house interior)"
  271. #define E_CMD_USAGE_ADDHCAR "Usage:{F6F6F6} /addhcar (house id)"
  272. #define E_CMD_USAGE_REMOVEHOUSE "Usage:{F6F6F6} /removehouse (houseid)"
  273. #define E_CMD_USAGE_REMOVEHCAR "Usage:{F6F6F6} /removehcar (house id)"
  274. #define E_CMD_USAGE_CHANGEHCAR "Usage:{F6F6F6} /changehcar (house id) (modelid: 400-612)"
  275. #define E_CMD_USAGE_CHANGESPAWN "Usage:{F6F6F6} /changespawn (houseid)"
  276. #define E_CMD_USAGE_GOTOHOUSE "Usage:{F6F6F6} /gotohouse (houseid)"
  277. #define E_CMD_USAGE_SELLHOUSE "Usage:{F6F6F6} /sellhouse (houseid)"
  278. #define E_CMD_USAGE_CHANGEPRICE "Usage:{F6F6F6} /changeprice (houseid) (price)"
  279. #define E_CMD_USAGE_CHANGEALLPRICE "Usage:{F6F6F6} /changeallprices (price)"
  280. #define E_INVALID_HINT_ID "{F6F6F6}Invalid house interior ID."
  281. #define I_HINT_SPAWN_CHANGED "{F6F6F6}You have changed the spawn position and angel for house interior ID %d."
  282. #define I_HINT_CREATED "{F6F6F6}House interior ID {00BC00}%d {F6F6F6}created...\n{00BC00}House Interior Value: {F6F6F6}$%d\n{00BC00}House Interior Name: {F6F6F6}%s"
  283. #define E_TOO_MANY_HINTS "{F6F6F6}Sorry, but there are already {00BC00}%d {F6F6F6}house interiors created.\nDelete one of the current ones or increase the limit in the script."
  284. #define E_INVALID_HINT_VALUE "{F6F6F6}Invalid house interior value. The value must be between {00BC00}$"#MIN_HINT_VALUE" {F6F6F6}and {00BC00}$"#MAX_HINT_VALUE"{F6F6F6}."
  285. #define E_INVALID_HINT_LENGTH "{F6F6F6}Invalid house interior name length. The length must be between {00BC00}"#MIN_HINT_NAME" {F6F6F6}and {00BC00}"#MAX_HINT_NAME"{F6F6F6}."
  286. #define I_HINT_DESTROYED "{F6F6F6}House interior ID {00BC00}%d {F6F6F6}has been deleted..."
  287. #define E_NO_HOUSESTORAGE "{F6F6F6}The house storage feature has been disabled in this server. You can not use it."
  288. #define I_HOWNER_HINFO_1 "{00BC00}House Name: {F6F6F6}%s\n{00BC00}House Location: {F6F6F6}%s\n{00BC00}Distance to house from you: {F6F6F6}%0.2f feet\n"
  289. #define I_HOWNER_HINFO_2 "{00BC00}House Value: {F6F6F6}$%d\n{00BC00}House Storage: {F6F6F6}$%d\n{00BC00}House Privacy: {F6F6F6}%s\n{00BC00}House ID: {F6F6F6}%d"
  290. #define HMENU_ENTER_PASS "{00BC00}House Name: {F6F6F6}%s\n{00BC00}House Owner: {F6F6F6}%s\n{00BC00}House Value: {F6F6F6}$%d\n{00BC00}House ID: {F6F6F6}%d\n\nEnter The Password For The House Below If You Wish To Enter:"
  291. #define I_HINT_DEPOSIT1 "{F6F6F6}You have {00BC00}$%d {F6F6F6}in your house storage.\n\nType in the amount you want to deposit below:"
  292. #define I_HINT_WITHDRAW1 "{F6F6F6}You have {00BC00}$%d {F6F6F6}in your house storage.\n\nType in the amount you want to withdraw below:"
  293. #define I_HINT_DEPOSIT2 "{F6F6F6}You have successfully deposited {00BC00}$%d {F6F6F6}Into your house storage.\n{00BC00}Current Balance: {F6F6F6}$%d"
  294. #define I_HINT_WITHDRAW2 "{F6F6F6}You have successfully withdrawn {00BC00}$%d {F6F6F6}From your house storage.\n{00BC00}Current Balance: {F6F6F6}$%d"
  295. #define I_HINT_CHECKBALANCE "{F6F6F6}You have {00BC00}$%d {F6F6F6}in your house storage."
  296. #define E_HINT_DOESNT_EXIST "{F6F6F6}Invalid house interior. This house interior does not exist."
  297. #define HMENU_BUY_HOUSE "{F6F6F6}Do you want to buy this house for {00BC00}$%d{F6F6F6}?"
  298. #define HMENU_BUY_HINTERIOR "{F6F6F6}Do you want to buy the house interior {00BC00}%s {F6F6F6}for {00BC00}$%d{F6F6F6}?"
  299. #define HMENU_SELL_HOUSE "{F6F6F6}Are you sure you want to sell your house {00BC00}%s {F6F6F6}for {00BC00}$%d{F6F6F6}?"
  300. #define I_SELL_HOUSE1_1 "{F6F6F6}You have successfully sold your house for {00BC00}$%d\n"
  301. #define I_SELL_HOUSE1_2 "{00BC00}Selling Fee: {F6F6F6}$%d\nThe {00BC00}$%d {F6F6F6}in your house storage has been transfered to your pocket."
  302. #define I_SELL_HOUSE2 "{F6F6F6}You have successfully sold your house {00BC00}%s {F6F6F6}for {00BC00}$%d.\n{00BC00}Selling Fee: {F6F6F6}$%d"
  303. #define I_BUY_HOUSE "{F6F6F6}You have successfully bought this house for {00BC00}$%d{F6F6F6}!"
  304. #define I_HPASSWORD_CHANGED "{F6F6F6}You have successfully set the house password to {00BC00}%s{F6F6F6}!"
  305. #define I_HNAME_CHANGED "{F6F6F6}You have successfully set the house name to {00BC00}%s{F6F6F6}!"
  306. #define I_VISITING_HOUSEINT "{F6F6F6}You're now visiting the house interior {00BC00}%s{F6F6F6}.\nThis house interior costs {00BC00}$%d{F6F6F6}.\nYour visit time will end in {00BC00}%d {F6F6F6}minute%s."
  307. #define E_CANT_AFFORD_HINT1 "{F6F6F6}You can not afford to buy the house interior {00BC00}%s{F6F6F6}.\n{00BC00}House Interior Price: {F6F6F6}$%d\n"
  308. #define E_CANT_AFFORD_HINT2 "{00BC00}You have: {F6F6F6}$%d\n{00BC00}You Need: {F6F6F6}$%d"
  309. #define I_HINT_BOUGHT "{F6F6F6}You have bought the house interior {00BC00}%s {F6F6F6}for {00BC00}$%d."
  310. #define I_HS_WEAPONS1 "{F6F6F6}You have successfully stored {00BC00}%d {F6F6F6}weapon%s in your house storage."
  311. #define I_HS_WEAPONS2 "{F6F6F6}You have successfully received {00BC00}%d {F6F6F6}weapon%s from your house storage."
  312. #define E_INVALID_HVALUE "{F6F6F6}Invalid house value. The house value must be between {00BC00}$"#MIN_HOUSE_VALUE" {F6F6F6}and {00BC00}$"#MAX_HOUSE_VALUE"{F6F6F6}."
  313. #define I_HOPEN_FOR_VISITORS "{F6F6F6}You have successfully opened your house for visitors."
  314. #define I_CLOSED_FOR_VISITORS1 "{F6F6F6}You have successfully closed your house for visitors.\n{00BC00}Total visitors kicked out: {F6F6F6}%d"
  315. #define I_CLOSED_FOR_VISITORS2 "{00BC00}%s (%d) {F6F6F6}has closed their house for visitors. Automaticly exiting house..."
  316. #define E_MAX_HOUSES_OWNED "{F6F6F6}You already own {00BC00}%d {F6F6F6}house%s. Sell one of your others before buying a new."
  317. #define E_CANT_AFFORD_HOUSE "{F6F6F6}You can not afford to buy this house.\n{00BC00}House Value: {F6F6F6}$%d\n{00BC00}You Have: {F6F6F6}$%d\n{00BC00}You Need: {F6F6F6}$%d"
  318. #define I_SUCCESSFULL_BREAKIN1_1 "{00BC00}%s (%d) {F6F6F6}has successfully broken into your house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  319. #define I_SUCCESSFULL_BREAKIN1_2 "{F6F6F6}Someone has successfully broken into your house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  320. #define I_SUCCESSFULL_BREAKIN2 "{F6F6F6}You have successfully broken into this house.\n{00BC00}House Name: {F6F6F6}%s\n{00BC00}House Owner: {F6F6F6}%s"
  321. #define E_FAILED_BREAKIN1_1 "{00BC00}%s (%d) {F6F6F6}has failed to breakin to your house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  322. #define E_FAILED_BREAKIN1_2 "{F6F6F6}Someone has failed to breakin to your house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  323. #define E_FAILED_BREAKIN2 "{F6F6F6}You have failed to breakin to this house.\n{00BC00}House Name: {F6F6F6}%s\n{00BC00}House Owner: {F6F6F6}%s"
  324. #define E_NO_HOUSE_BREAKIN "{F6F6F6}The breakin feature has been disabled in this server. You can not use it."
  325. #define E_KICKED_NOT_IN_HOUSE "{F6F6F6}This player is not in your house."
  326. #define I_KICKED_FROM_HOUSE1 "{F6F6F6}You have kicked out {00BC00}%s (%d) {F6F6F6}from your house."
  327. #define I_KICKED_FROM_HOUSE2 "{F6F6F6}You have been kicked out from the house by {00BC00}%s (%d){F6F6F6}."
  328. #define E_ALREADY_HAVE_HOUSEKEYS "{F6F6F6}You have already given the house keys for this house to this player."
  329. #define I_HOUSEKEYS_RECIEVED_1 "{F6F6F6}You have given {00BC00}%s (%d) {F6F6F6}house keys to this house."
  330. #define I_HOUSEKEYS_RECIEVED_2 "{F6F6F6}You have been given house keys to {00BC00}%s {F6F6F6}in {00BC00}%s {F6F6F6}by {00BC00}%s (%d){F6F6F6}."
  331. #define E_DOESNT_HAVE_HOUSEKEYS "{F6F6F6}This player does not have the house keys for this house."
  332. #define I_HOUSEKEYS_TAKEN_1 "{F6F6F6}You have taken away {00BC00}%s's (%d) {F6F6F6}house keys to this house."
  333. #define I_HOUSEKEYS_TAKEN_2 "{00BC00}%s (%d) {F6F6F6}has taken away the house keys to his house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  334. #define E_NONE_IN_HOUSE "{F6F6F6}There isn't anyone in your house."
  335. #define E_CANT_ROB_OWN_HOUSE "{F6F6F6}You can not rob your own house."
  336. #define E_ALREADY_HAVE_ALARM "{F6F6F6}You have already bought a house alarm for this house."
  337. #define E_ALREADY_HAVE_CAMERA "{F6F6F6}You have already bought a security camera for this house."
  338. #define E_ALREADY_HAVE_DOG "{F6F6F6}You have already bought a security dog for this house."
  339. #define E_ALREADY_HAVE_UPGRADED_HLOCK "{F6F6F6}You have already bought a better doorlock for this house."
  340. #define E_NOT_ENOUGH_MONEY_ALARM "{F6F6F6}You do not have enough money to buy a house alarm for your house."
  341. #define E_NOT_ENOUGH_MONEY_CAMERA "{F6F6F6}You do not have enough money to buy a security camera for your house."
  342. #define E_NOT_ENOUGH_MONEY_DOG "{F6F6F6}You do not have enough money to buy a security dog for your house."
  343. #define E_NOT_ENOUGH_MONEY_UPGRADED_HLOCK "{F6F6F6}You do not have enough money to buy a better doorlock for your house."
  344. #define I_HUPGRADE_ALARM "{F6F6F6}You have bought a alarm for your house.\nThis alarm will warn you when someone tries to or succeed in either robbing or breaking into your house.\n{00BC00}Note: {F6F6F6}It does not notify you of who it is."
  345. #define I_HUPGRADE_CAMERA "{F6F6F6}You have bought a security camera for your house.\nThis security camera will warn you when someone tries to or succeed in either robbing or breaking into your house.\n{00BC00}Note: {F6F6F6}It does notify you of who it is."
  346. #define I_HUPGRADE_DOG "{F6F6F6}You have bought a security dog for your house.\nThis security dog will try to kill anyone who tries to either rob or breakin to your house."
  347. #define I_HUPGRADE_UPGRADED_HLOCK "{F6F6F6}You have bought upgraded the doorlock for your house.\nIt will now be harder to breakin to your house."
  348. #define E_FAILED_HROB1_1 "{00BC00}%s (%d) {F6F6F6}has failed to rob your house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  349. #define E_FAILED_HROB1_2 "{F6F6F6}Someone has failed to rob your house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  350. #define I_HROB_STARTED1_1 "{F6F6F6}Someone is currently robbing your house %s {F6F6F6}in %s{F6F6F6}."
  351. #define I_HROB_STARTED1_2 "{00BC00}%s (%d) {F6F6F6}is currently robbing your house %s {F6F6F6}in %s{F6F6F6}."
  352. #define I_HROB_STARTED2 "{F6F6F6}You have started the robbery of {00BC00}%s's {F6F6F6}house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}.\n\n{00BC00}Stay alive and do not leave the house until the robbery finishes!"
  353. #define E_HROB_OWNER_NOT_CONNECTED "{F6F6F6}You can not rob this house since the owner of it is not connected."
  354. #define I_HROB_FAILED_DEATH "{F6F6F6}You have died.\nThe attempt to rob the house {00BC00}%s {F6F6F6}has failed."
  355. #define I_HROB_FAILED_HEXIT "{F6F6F6}You have left the house.\nThe attempt to rob the house {00BC00}%s {F6F6F6}has failed."
  356. #define I_HROB_FAILED_NOT_IN_HOUSE "{F6F6F6}You are not in the house you were attempting to rob.\nThe attempt to rob the house {00BC00}%s {F6F6F6}has failed."
  357. #define E_FAILED_HROB2 "{F6F6F6}House robbery failed."
  358. #define I_HROB_COMPLETED1_1 "{F6F6F6}Your house {00BC00}%s {F6F6F6}in {00BC00}%s {F6F6F6}has been robbed for {00BC00}$%d{F6F6F6}."
  359. #define I_HROB_COMPLETED1_2 "{00BC00}%s (%d) {F6F6F6}has robbed your house {00BC00}%s {F6F6F6}in {00BC00}%s {F6F6F6}for {00BC00}$%d{F6F6F6}."
  360. #define I_HROB_COMPLETED2 "{F6F6F6}House robbery completed.\nYou got away with {00BC00}$%d {F6F6F6}from {00BC00}%s's {F6F6F6}house {00BC00}%s {F6F6F6}in {00BC00}%s{F6F6F6}."
  361. #define HROB_FAILED1 "{F6F6F6}You have been bit to death by the security dog for this house.\nRobbery failed."
  362. #define HBREAKIN_FAILED1 "{F6F6F6}You have been bit to death by the security dog for this house.\nHouse breakin failed."
  363. #define E_WAIT_BEFORE_BREAKIN "{F6F6F6}Please wait before attempting to breakin to a house again."
  364. #define E_WAIT_BEFORE_ROBBING "{F6F6F6}Please wait before attempting to rob a house again."
  365. #define E_ALREADY_ROBBING_HOUSE "{F6F6F6}You are already robbing a house."
  366. #define HROB_FAILED2 "{F6F6F6}House robbery failed.\nYou have been bit by the security dog for this house."
  367. #define HBREAKIN_FAILED2 "{F6F6F6}House breakin failed.\nYou have been bit by the security dog for this house."
  368. //==============================================================================
  369. // Awesomeness
  370. //==============================================================================
  371. main()
  372. {
  373. print("\n----------------------------------");
  374. print(" Blank Gamemode by your name here");
  375. print("----------------------------------\n");
  376. // Maybe
  377. print("\n>> Attempting to load GarHouse v2.0... <<\n");
  378. INI_Load("/GarHouse/House.ini");
  379. LoadHouses(); // Load houses
  380. foreach(Player, i)
  381. {
  382. SetPVarInt(i, "HousePrevTime", 0);
  383. SetPVarInt(i, "TimeSinceHouseRobbery", 0);
  384. SetPVarInt(i, "TimeSinceHouseBreakin", 0);
  385. SetPVarInt(i, "HouseRobberyTimer", -1);
  386. }
  387. print("\n>> GarHouse v2.0 By [03]Garsino Loaded <<\n");
  388. }
  389.  
  390. public OnGameModeInit()
  391. {
  392. // Don't use these lines if it's a filterscript
  393. SetGameModeText("Blank Script");
  394. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  395. return 1;
  396. }
  397.  
  398. public OnGameModeExit()
  399. {
  400. new INI:file, lasthcp;
  401. foreach(Player, i)
  402. {
  403. EndHouseRobbery(i);
  404. SetPVarInt(i, "IsRobbingHouse", 0);
  405. lasthcp = GetPVarInt(i, "LastHouseCP");
  406. if(!strcmp(hInfo[lasthcp][HouseOwner], pNick(i), CASE_SENSETIVE) && IsInHouse{i} == 1 && fexist(HouseFile(lasthcp)))
  407. {
  408. file = INI_Open(HouseFile(lasthcp));
  409. INI_WriteInt(file, "QuitInHouse", 1);
  410. INI_Close(file);
  411. #if GH_HOUSECARS == true
  412. SaveHouseCar(lasthcp);
  413. #endif
  414. }
  415. ExitHouse(i, lasthcp);
  416. DeletePVars(i);
  417. }
  418. UnloadHouses(); // Unload houses (also unloads the house cars)
  419. print("\n>> GarHouse v2.0 By [03]Garsino Unloaded <<\n");
  420. return 1;
  421. }
  422.  
  423. public OnPlayerRequestClass(playerid, classid)
  424. {
  425. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  426. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  427. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  428. return 1;
  429. }
  430.  
  431. public OnPlayerConnect(playerid)
  432. {
  433. new filename[HOUSEFILE_LENGTH], string1[MAX_PLAYER_NAME], string2[MAX_HOUSE_NAME], _tmpstring[256];
  434. format(filename, sizeof(filename), USERPATH, pNick(playerid));
  435. if(fexist(filename))
  436. {
  437. new hs = GetPVarInt(playerid, "GA_TMP_HOUSESTORAGE"), price = GetPVarInt(playerid, "GA_TMP_HOUSEFORSALEPRICE");
  438. INI_ParseFile(filename, "LoadUserData", false, true, playerid, true, false);
  439. fremove(filename);
  440. GetPVarString(playerid, "GA_TMP_NEWHOUSEOWNER", string2, MAX_PLAYER_NAME);
  441. GetPVarString(playerid, "GA_TMP_HOUSENAME", string1, MAX_HOUSE_NAME);
  442. CMDSString = "";
  443. format(_tmpstring, sizeof(_tmpstring), HSELLER_OFFLINE_MSG1, string1, string2);
  444. strcat(CMDSString, _tmpstring);
  445. format(_tmpstring, sizeof(_tmpstring), HSELLER_OFFLINE_MSG2, (hs + price), hs, price);
  446. strcat(CMDSString, _tmpstring);
  447. ShowInfoBoxEx(playerid, COLOUR_INFO, CMDSString);
  448. DeletePVar(playerid, "GA_TMP_HOUSESTORAGE"), DeletePVar(playerid, "GA_TMP_HOUSEFORSALEPRICE"), DeletePVar(playerid, "GA_TMP_NEWHOUSEOWNER"), DeletePVar(playerid, "GA_TMP_HOUSENAME");
  449. }
  450. SetPVarInt(playerid, "HouseRobberyTimer", -1);
  451. IsInHouse{playerid} = 0;
  452. return 1;
  453. }
  454.  
  455. public OnPlayerDisconnect(playerid, reason)
  456. {
  457. new year, month, day, lastvisited[20], lasthcp = GetPVarInt(playerid, "LastHouseCP");
  458. EndHouseRobbery(playerid);
  459. if(!strcmp(hInfo[lasthcp][HouseOwner], pNick(playerid), CASE_SENSETIVE) && IsInHouse{playerid} == 1 && fexist(HouseFile(lasthcp)))
  460. {
  461. getdate(year, month, day);
  462. format(lastvisited, sizeof(lastvisited), "%02d/%02d/%d", day, month, year);
  463. new INI:file = INI_Open(HouseFile(lasthcp));
  464. INI_WriteInt(file, "QuitInHouse", 1);
  465. INI_WriteString(file, "LastVisited", lastvisited);
  466. INI_Close(file);
  467. #if GH_HOUSECARS == true
  468. SaveHouseCar(lasthcp);
  469. UnloadHouseCar(lasthcp);
  470. #endif
  471. }
  472. IsInHouse{playerid} = 0;
  473. return 1;
  474. }
  475.  
  476. public OnPlayerSpawn(playerid)
  477. {
  478. if(GetPVarInt(playerid, "IsAnimsPreloaded") == 0)
  479. {
  480. ApplyAnimation(playerid, "CRACK", "null", 0.0, 0, 0, 0, 0, 0);
  481. SetPVarInt(playerid, "IsAnimsPreloaded", 1);
  482. }
  483. #if SPAWN_IN_HOUSE == true
  484. if(GetPVarInt(playerid, "FirstSpawn") == 0)
  485. {
  486. SetTimerEx("HouseSpawning", HSPAWN_TIMER_RATE, false, "i", playerid); // Increase timer rate if your gamemodes OnPlayerSpawn gets called after the timer has ended
  487. }
  488. #endif
  489. return 1;
  490. }
  491.  
  492. public OnPlayerDeath(playerid, killerid, reason)
  493. {
  494. if(GetPVarInt(playerid, "IsRobbingHouse") == 1)
  495. {
  496. ShowInfoBox(playerid, I_HROB_FAILED_DEATH, hInfo[GetPVarInt(playerid, "LastHouseCP")][HouseName]);
  497. EndHouseRobbery(playerid);
  498. SetPVarInt(playerid, "IsRobbingHouse", 0);
  499. SetPVarInt(playerid, "TimeSinceHouseRobbery", GetTickCount());
  500. }
  501. return 1;
  502. }
  503.  
  504. public OnVehicleSpawn(vehicleid)
  505. {
  506. return 1;
  507. }
  508.  
  509. public OnVehicleDeath(vehicleid, killerid)
  510. {
  511. return 1;
  512. }
  513.  
  514. public OnPlayerText(playerid, text[])
  515. {
  516. return 1;
  517. }
  518.  
  519. public OnPlayerCommandText(playerid, cmdtext[])
  520. {
  521. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  522. {
  523. // Do something here
  524. return 1;
  525. }
  526. return 0;
  527. }
  528. //==============================================================================
  529. // GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
  530. // Used to get the position infront of a player.
  531. // Credits to whoever made this!
  532. //==============================================================================
  533. stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  534. {
  535. new Float:a;
  536. GetPlayerPos(playerid, x, y, a);
  537. switch(IsPlayerInAnyVehicle(playerid))
  538. {
  539. case 0: GetPlayerFacingAngle(playerid, a);
  540. case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  541. }
  542. x += (distance * floatsin(-a, degrees));
  543. y += (distance * floatcos(-a, degrees));
  544. return a;
  545. }
  546. CMD:money(playerid, params[])
  547. {
  548. GivePlayerMoney(playerid, 100000);
  549. return 1;
  550. }
  551. //##############################################################################
  552. // Commands
  553. //##############################################################################
  554. // By [03]Garsino!
  555. //==============================================================================
  556. // This command is used to display the house owner menu
  557. // when a player is in a house and is the house owner.
  558. //==============================================================================
  559. CMD:housemenu(playerid, params[])
  560. {
  561. #pragma unused params
  562. new h = GetPVarInt(playerid, "LastHouseCP");
  563. if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && IsInHouse{playerid} == 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_C_ACCESS_SE_HM);
  564. if(IsInHouse{playerid} == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_IN_HOUSE);
  565. if(GetOwnedHouses(playerid) == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_HOWNER);
  566. if(IsInHouse{playerid} == 1 && !strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && GetOwnedHouses(playerid) >= 1)
  567. {
  568. #if GH_HINTERIOR_UPGRADE == true
  569. ShowPlayerDialog(playerid, HOUSEMENU, DIALOG_STYLE_LIST, INFORMATION_HEADER, "House Selling\nHouse Storage\nSet House Name\nSet House Password\nBuy/Preview House Interior\nToggle House Privacy\nManage Players In House\nHouse Security", "Select", "Cancel");
  570. #else
  571. ShowPlayerDialog(playerid, HOUSEMENU, DIALOG_STYLE_LIST, INFORMATION_HEADER, "House Selling\nHouse Storage\nSet House Name\nSet House Password\nToggle House Privacy\nManage Players In House\nHouse Security", "Select", "Cancel");
  572. #endif
  573. }
  574. return 1;
  575. }
  576. //==============================================================================
  577. // This command is used to trigger a house robbery
  578. //==============================================================================
  579. #if GH_ALLOW_HOUSEROBBERY == true
  580. CMD:robhouse(playerid, params[])
  581. {
  582. #pragma unused params
  583. new h = GetPVarInt(playerid, "LastHouseCP"), houseowner = GetHouseOwnerEx(GetPVarInt(playerid, "LastHouseCP")), robtime = GetPVarInt(playerid, "TimeSinceHouseBreakin");
  584. if(IsInHouse{playerid} == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_IN_HOUSE);
  585. if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CANT_ROB_OWN_HOUSE);
  586. if(!IsPlayerConnected(houseowner)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_HROB_OWNER_NOT_CONNECTED);
  587. if(GetPVarInt(playerid, "IsRobbingHouse") == 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_ALREADY_ROBBING_HOUSE);
  588. if(GetSecondsBetweenAction(robtime) < (TIME_BETWEEN_ROBBERIES * 60000) && robtime != 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_WAIT_BEFORE_ROBBING);
  589. switch(random(10000))
  590. {
  591. case 0..6999: // Failed robbery
  592. {
  593. switch(hInfo[h][HouseCamera])
  594. {
  595. case 0:
  596. {
  597. if(hInfo[h][HouseAlarm] == 1)
  598. {
  599. ShowInfoBox(houseowner, E_FAILED_HROB1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  600. }
  601. }
  602. case 1: ShowInfoBox(houseowner, E_FAILED_HROB1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  603. }
  604. SecurityDog_Bite(playerid, h, 1, 1);
  605. ShowInfoBox(playerid, E_FAILED_HROB2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
  606. }
  607. case 7000..9999: // Successfull robbery
  608. {
  609. switch(hInfo[h][HouseCamera])
  610. {
  611. case 0:
  612. {
  613. if(hInfo[h][HouseAlarm] == 1)
  614. {
  615. ShowInfoBox(houseowner, I_HROB_STARTED1_1, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  616. }
  617. }
  618. case 1: ShowInfoBox(houseowner, I_HROB_STARTED1_2, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  619. }
  620. ShowInfoBox(playerid, I_HROB_STARTED2, hInfo[h][HouseOwner], hInfo[h][HouseName], hInfo[h][HouseLocation]);
  621. SetPVarInt(playerid, "IsRobbingHouse", 1), SetPVarInt(playerid, "HouseRobberyTime", RandomEx(MIN_ROB_TIME, MAX_ROB_TIME));
  622. SetPVarInt(playerid, "HouseRobberyTimer", SetTimerEx("HouseRobbery", 999, true, "ii", playerid, h));
  623. }
  624. }
  625. #if GH_GIVE_WANTEDLEVEL == true
  626. if((GetPlayerWantedLevel(playerid) + HROBBERY_WL) > GH_MAX_WANTED_LEVEL)
  627. {
  628. SetPlayerWantedLevel(playerid, GH_MAX_WANTED_LEVEL);
  629. }
  630. else SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + HROBBERY_WL));
  631. #endif
  632. SetPVarInt(playerid, "TimeSinceHouseRobbery", GetTickCount());
  633. return 1;
  634. }
  635. #endif
  636. #if GH_ALLOW_HOUSEROBBERY == true
  637. function HouseRobbery(playerid, houseid)
  638. {
  639. new robberytime = GetPVarInt(playerid, "HouseRobberyTime");
  640. if(GetPVarInt(playerid, "IsRobbingHouse") == 1)
  641. {
  642. switch(robberytime)
  643. {
  644. case 1..MAX_ROB_TIME: GameTextEx(playerid, 999, 3, "~n~ ~g~Robbery in Progress... ~n~ ~r~%d ~w~Seconds Remaining...", robberytime);
  645. case 0:
  646. {
  647. switch(IsPlayerInHouse(playerid, houseid))
  648. {
  649. case 0: ShowInfoBox(playerid, I_HROB_FAILED_NOT_IN_HOUSE, hInfo[houseid][HouseName]);
  650. case 1:
  651. {
  652. new RobAmount = ReturnProcent(hInfo[houseid][HouseStorage], HOUSE_ROBBERY_PERCENT), houseowner = GetHouseOwnerEx(houseid);
  653. if(RobAmount > MAX_MONEY_ROBBED)
  654. {
  655. RobAmount = MAX_MONEY_ROBBED;
  656. }
  657. if(IsPlayerConnected(houseowner))
  658. {
  659. switch(hInfo[houseid][HouseCamera])
  660. {
  661. case 0:
  662. {
  663. if(hInfo[houseid][HouseAlarm] == 1)
  664. {
  665. ShowInfoBox(houseowner, I_HROB_COMPLETED1_2, hInfo[houseid][HouseName], hInfo[houseid][HouseLocation], RobAmount);
  666. }
  667. }
  668. case 1: ShowInfoBox(houseowner, I_HROB_COMPLETED1_1, pNick(playerid), playerid, hInfo[houseid][HouseName], hInfo[houseid][HouseLocation], RobAmount);
  669. }
  670. }
  671. hInfo[houseid][HouseStorage] -= RobAmount;
  672. new INI:file = INI_Open(HouseFile(houseid));
  673. INI_WriteInt(file, "HouseStorage", hInfo[houseid][HouseStorage]);
  674. INI_Close(file);
  675. GivePlayerMoney(playerid, RobAmount);
  676. ShowInfoBox(playerid, I_HROB_COMPLETED2, RobAmount, hInfo[houseid][HouseOwner], hInfo[houseid][HouseName], hInfo[houseid][HouseLocation]);
  677. GameTextEx(playerid, 4500, 3, "~n~ ~p~Robbery Completed~w~! ~n~ Robbed ~g~$%d~w~!", RobAmount);
  678. }
  679. }
  680. EndHouseRobbery(playerid);
  681. SetPVarInt(playerid, "IsRobbingHouse", 0);
  682. SetPVarInt(playerid, "TimeSinceHouseRobbery", GetTickCount());
  683. DeletePVar(playerid, "HouseRobberyTimer");
  684. }
  685. }
  686. }
  687. return SetPVarInt(playerid, "HouseRobberyTime", (robberytime - 1));
  688. }
  689. #endif
  690. //==============================================================================
  691. // This command is used to display the players houses.
  692. //==============================================================================
  693. CMD:myhouses(playerid, params[])
  694. {
  695. #pragma unused params
  696. if(GetOwnedHouses(playerid) == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NO_HOUSES_OWNED);
  697. new h, _tmpstring[128], count = GetOwnedHouses(playerid);
  698. CMDSString = "";
  699. Loop(i, (count + 1), 1)
  700. {
  701. h = ReturnPlayerHouseID(playerid, i);
  702. if(i == count)
  703. {
  704. format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s in %s", i, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  705. }
  706. else format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s in %s\n", i, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  707. strcat(CMDSString, _tmpstring);
  708. }
  709. ShowPlayerDialog(playerid, HOUSEMENU+50, DIALOG_STYLE_LIST, INFORMATION_HEADER, CMDSString, "Select", "Cancel");
  710. return 1;
  711. }
  712. //==============================================================================
  713. // This command is used to create a house.
  714. // The only thing you have to enter is the house value,
  715. // the rest is done by the script.
  716. //==============================================================================
  717. CMD:createhouse(playerid, params[])
  718. {
  719. new cost, h = GetFreeHouseID(), labeltext[250], hint;
  720. if(!IsPlayerAdmin(playerid)) return 0;
  721. if(sscanf(params, "dD(" #DEFAULT_H_INTERIOR ")", cost, hint)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CREATEHOUSE);
  722. if(h < 0)
  723. {
  724. ShowInfoBox(playerid, E_TOO_MANY_HOUSES, MAX_HOUSES);
  725. return 1;
  726. }
  727. if(hint < 0 || hint > MAX_HOUSE_INTERIORS) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HINT);
  728. if(IsHouseInteriorValid(hint) == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_HINT_DOESNT_EXIST);
  729. if(cost < MIN_HOUSE_VALUE || cost > MAX_HOUSE_VALUE) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HVALUE);
  730. else
  731. {
  732. fcreate(HouseFile(h));
  733. GetPlayerPos(playerid, X, Y, Z);
  734. GetPlayerFacingAngle(playerid, Angle);
  735. new world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
  736. hInfo[h][CPOutX] = X, hInfo[h][CPOutY] = Y, hInfo[h][CPOutZ] = Z;
  737. format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", DEFAULT_HOUSE_NAME);
  738. format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", INVALID_HOWNER_NAME);
  739. format(hInfo[h][HouseLocation], MAX_ZONE_NAME, "%s", GetHouseLocation(h));
  740. hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
  741. hInfo[h][HouseValue] = cost, hInfo[h][HouseStorage] = 0;
  742. new INI:file = INI_Open(HouseFile(h));
  743. INI_WriteFloat(file, "CPOutX", X);
  744. INI_WriteFloat(file, "CPOutY", Y);
  745. INI_WriteFloat(file, "CPOutZ", Z);
  746. INI_WriteString(file, "HouseName", DEFAULT_HOUSE_NAME);
  747. INI_WriteString(file, "HouseOwner", INVALID_HOWNER_NAME);
  748. INI_WriteString(file, "HouseLocation", hInfo[h][HouseLocation]);
  749. INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
  750. INI_WriteString(file, "HouseCreator", pNick(playerid));
  751. INI_WriteInt(file, "HouseValue", cost);
  752. INI_WriteInt(file, "HouseStorage", 0);
  753. format(labeltext, sizeof(labeltext), LABELTEXT1, DEFAULT_HOUSE_NAME, cost, h);
  754. #if GH_USE_CPS == true
  755. HouseCPOut[h] = CreateDynamicCP(X, Y, Z, 1.5, world, interior, -1, CP_DRAWDISTANCE);
  756. HouseCPInt[h] = CreateDynamicCP(hIntInfo[hint][IntCPX], hIntInfo[hint][IntCPY], hIntInfo[hint][IntCPZ], 1.5, (h + 1000), hIntInfo[hint][IntInterior], -1, 15.0);
  757. #else
  758. HousePickupOut[h] = CreateDynamicPickup(PICKUP_MODEL_OUT, PICKUP_TYPE, X, Y, Z, world, interior, -1, 15.0);
  759. HousePickupInt[h] = CreateDynamicPickup(PICKUP_MODEL_INT, PICKUP_TYPE, hIntInfo[hint][IntCPX], hIntInfo[hint][IntCPY], hIntInfo[hint][IntCPZ], (h + 1000), hIntInfo[hint][IntInterior], -1, 15.0);
  760. #endif
  761. #if GH_USE_MAPICONS == true
  762. HouseMIcon[h] = CreateDynamicMapIcon(X, Y, Z, 31, -1, world, interior, -1, 50.0);
  763. #endif
  764. HouseLabel[h] = CreateDynamic3DTextLabel(labeltext, COLOUR_GREEN, X, Y, Z+0.7, TEXTLABEL_DISTANCE, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, TEXTLABEL_TESTLOS, world, interior, -1, TEXTLABEL_DISTANCE);
  765. ShowInfoBox(playerid, I_H_CREATED, h);
  766. GetPosInFrontOfPlayer(playerid, X, Y, -2.5);
  767. INI_WriteFloat(file, "SpawnOutX", X);
  768. INI_WriteFloat(file, "SpawnOutY", Y);
  769. INI_WriteFloat(file, "SpawnOutZ", Z);
  770. INI_WriteFloat(file, "SpawnOutAngle", (180.0 + Angle));
  771. INI_WriteInt(file, "SpawnWorld", world);
  772. INI_WriteInt(file, "SpawnInterior", interior);
  773. INI_WriteInt(file, "HouseInterior", hint);
  774. hInfo[h][SpawnOutX] = X, hInfo[h][SpawnOutY] = Y, hInfo[h][SpawnOutZ] = Z, hInfo[h][SpawnOutAngle] = (180.0 + Angle);
  775. hInfo[h][SpawnWorld] = world, hInfo[h][SpawnInterior] = interior, hInfo[h][HouseInterior] = hint;
  776. hInfo[h][HouseAlarm] = hInfo[h][HouseDog] = hInfo[h][HouseCamera] = hInfo[h][UpgradedLock] = 0;
  777. INI_Close(file);
  778. CurrentID++;
  779. file = INI_Open("/GarHouse/House.ini");
  780. INI_WriteInt(file, "CurrentID", CurrentID);
  781. INI_Close(file);
  782. SetPVarInt(playerid, "JustCreatedHouse", 1);
  783. Iter_Add(Houses, h);
  784. }
  785. return 1;
  786. }
  787. //==============================================================================
  788. // This command is used to add a house car for a house.
  789. // The only thing you have to enter is the house value,
  790. // the rest is done by the script.
  791. //==============================================================================
  792. CMD:addhcar(playerid, params[])
  793. {
  794. new h;
  795. if(!IsPlayerAdmin(playerid)) return 0;
  796. if(!IsPlayerInAnyVehicle(playerid)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_HCAR_NOT_IN_VEH);
  797. if(sscanf(params, "d", h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_ADDHCAR);
  798. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  799. else
  800. {
  801. if(hInfo[h][HouseCar] == 1) { ShowInfoBox(playerid, I_HCAR_EXIST_ALREADY, h); }
  802. if(hInfo[h][HouseCar] == 0) { ShowInfoBox(playerid, I_HCAR_CREATED, h); }
  803. GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
  804. GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
  805. new world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
  806. hInfo[h][HouseCar] = 1, hInfo[h][HouseCarPosX] = X, hInfo[h][HouseCarPosY] = Y, hInfo[h][HouseCarPosZ] = Z, hInfo[h][HouseCarAngle] = Angle;
  807. hInfo[h][HouseCarModel] = GetVehicleModel(GetPlayerVehicleID(playerid)), hInfo[h][HouseCarInterior] = interior, hInfo[h][HouseCarWorld] = world;
  808. new INI:file = INI_Open(HouseFile(h));
  809. INI_WriteFloat(file, "HCarPosX", X);
  810. INI_WriteFloat(file, "HCarPosY", Y);
  811. INI_WriteFloat(file, "HCarPosZ", Z);
  812. INI_WriteFloat(file, "HCarAngle", Angle);
  813. INI_WriteInt(file, "HCar", 1);
  814. INI_WriteInt(file, "HCarWorld", world);
  815. INI_WriteInt(file, "HCarInt", interior);
  816. INI_WriteInt(file, "HCarModel", hInfo[h][HouseCarModel]);
  817. INI_Close(file);
  818. }
  819. return 1;
  820. }
  821. //==============================================================================
  822. // This command is used to delete a house.
  823. // Note: It does not give any money to the house owner when the house is deleted
  824. //==============================================================================
  825. CMD:removehouse(playerid, params[])
  826. {
  827. new h;
  828. if(!IsPlayerAdmin(playerid)) return 0;
  829. if(sscanf(params, "d", h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_REMOVEHOUSE);
  830. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  831. else
  832. {
  833. foreach(Player, i)
  834. {
  835. if(IsInHouse{i} == 0) continue;
  836. ExitHouse(i, h);
  837. }
  838. DestroyHouseEntrance(h, TYPE_OUT);
  839. DestroyHouseEntrance(h, TYPE_INT);
  840. #if GH_USE_MAPICONS == true
  841. DestroyDynamicMapIcon(HouseMIcon[h]);
  842. #endif
  843. DestroyDynamic3DTextLabel(HouseLabel[h]);
  844. ShowInfoBox(playerid, I_H_DESTROYED, h);
  845. fremove(HouseFile(h));
  846. Iter_Remove(Houses, h);
  847. }
  848. return 1;
  849. }
  850. //==============================================================================
  851. // This command is used to remove the house car for a house.
  852. //==============================================================================
  853. CMD:removehcar(playerid, params[])
  854. {
  855. new h;
  856. if(!IsPlayerAdmin(playerid)) return 0;
  857. if(sscanf(params, "d", h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_REMOVEHCAR);
  858. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  859. if(hInfo[h][HouseCar] == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NO_HCAR);
  860. else
  861. {
  862. UnloadHouseCar(h);
  863. hInfo[h][HouseCar] = 0;
  864. new INI:file = INI_Open(HouseFile(h));
  865. INI_WriteInt(file, "HCar", 0);
  866. INI_Close(file);
  867. ShowInfoBox(playerid, I_HCAR_REMOVED, h);
  868. }
  869. return 1;
  870. }
  871. //==============================================================================
  872. // This command is used to change the modelid of a housecar.
  873. //==============================================================================
  874. CMD:changehcar(playerid, params[])
  875. {
  876. new h, modelid;
  877. if(!IsPlayerAdmin(playerid)) return 0;
  878. if(sscanf(params, "dd", h, modelid)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CHANGEHCAR);
  879. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  880. if(modelid < 400 || modelid > 612) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HCAR_MODEL);
  881. else
  882. {
  883. hInfo[h][HouseCarModel] = modelid;
  884. new INI:file = INI_Open(HouseFile(h));
  885. INI_WriteInt(file, "HCarModel", modelid);
  886. INI_Close(file);
  887. ShowInfoBox(playerid, I_HCAR_CHANGED, h, modelid);
  888. #if GH_HOUSECARS == true
  889. if(GetVehicleModel(HCar[h]) != -1)
  890. {
  891. if(IsVehicleOccupied(HCar[h]))
  892. {
  893. new Float:Velocity[3], Float:Pos[4], Seat[MAX_PLAYERS char] = -1, interior, vw = GetVehicleVirtualWorld(HCar[h]);
  894. foreach(Player, i)
  895. {
  896. if(IsPlayerInVehicle(i, HCar[h]))
  897. {
  898. Seat{i} = GetPlayerVehicleSeat(i);
  899. if(Seat{i} == 0)
  900. {
  901. interior = GetPlayerInterior(i); // Have to do it this way because there is no GetVehicleInterior..
  902. }
  903. }
  904. }
  905. GetVehiclePos(HCar[h], Pos[0], Pos[1], Pos[2]);
  906. GetVehicleZAngle(HCar[h], Pos[3]);
  907. GetVehicleVelocity(HCar[h], Velocity[0], Velocity[1], Velocity[2]);
  908. DestroyVehicle(HCar[h]);
  909. HCar[h] = CreateVehicle(modelid, Pos[0], Pos[1], Pos[2], Pos[3], HCAR_COLOUR1, HCAR_COLOUR2, HCAR_RESPAWN);
  910. LinkVehicleToInterior(HCar[h], interior);
  911. SetVehicleVirtualWorld(HCar[h], vw);
  912. foreach(Player, i)
  913. {
  914. if(Seat[i] != -1)
  915. {
  916. PutPlayerInVehicle(i, HCar[h], Seat{i});
  917. Seat{i} = -1;
  918. }
  919. }
  920. SetVehicleVelocity(HCar[h], Velocity[0], Velocity[1], Velocity[2]);
  921. }
  922. if(!IsVehicleOccupied(HCar[h]))
  923. {
  924. UnloadHouseCar(h);
  925. LoadHouseCar(h);
  926. }
  927. }
  928. #endif
  929. }
  930. return 1;
  931. }
  932. //==============================================================================
  933. // This command is used to delete all houses.
  934. // It does not give any money to the house owners when the houses is deleted.
  935. //==============================================================================
  936. CMD:removeallhouses(playerid, params[])
  937. {
  938. #pragma unused params
  939. new hcount;
  940. if(!IsPlayerAdmin(playerid)) return 0;
  941. else
  942. {
  943. foreach(Houses, h)
  944. {
  945. foreach(Player, i)
  946. {
  947. if(IsInHouse{i} == 0) continue;
  948. ExitHouse(i, h);
  949. }
  950. UnloadHouseCar(h);
  951. DestroyHouseEntrance(h, TYPE_OUT);
  952. DestroyHouseEntrance(h, TYPE_INT);
  953. #if GH_USE_MAPICONS == true
  954. DestroyDynamicMapIcon(HouseMIcon[h]);
  955. #endif
  956. DestroyDynamic3DTextLabel(HouseLabel[h]);
  957. fremove(HouseFile(h));
  958. hcount++;
  959. Iter_Remove(Houses, h);
  960. }
  961. ShowInfoBox(playerid, I_ALLH_DESTROYED, hcount);
  962. }
  963. return 1;
  964. }
  965. //==============================================================================
  966. // This command is used remove all house cars.
  967. // It does not delete the house cars itself due to SA:MP mixing up vehicle ID's.
  968. //==============================================================================
  969. CMD:removeallhcars(playerid, params[])
  970. {
  971. #pragma unused params
  972. new hcount, INI:file, filename[HOUSEFILE_LENGTH];
  973. if(!IsPlayerAdmin(playerid)) return 0;
  974. else
  975. {
  976. foreach(Houses, h)
  977. {
  978. UnloadHouseCar(h);
  979. hInfo[h][HouseCar] = 0;
  980. file = INI_Open(filename);
  981. INI_WriteInt(file, "HCar", 0);
  982. INI_Close(file);
  983. }
  984. ShowInfoBox(playerid, I_ALLHCAR_REMOVED, hcount);
  985. }
  986. return 1;
  987. }
  988. //==============================================================================
  989. // This command is used to change the spawnposition details of a house
  990. //==============================================================================
  991. CMD:changespawn(playerid, params[])
  992. {
  993. new h;
  994. if(!IsPlayerAdmin(playerid)) return 0;
  995. if(sscanf(params, "d", h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CHANGESPAWN);
  996. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  997. else
  998. {
  999. GetPlayerPos(playerid, X, Y, Z);
  1000. GetPlayerFacingAngle(playerid, Angle);
  1001. new world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
  1002. hInfo[h][SpawnOutX] = X, hInfo[h][SpawnOutY] = Y, hInfo[h][SpawnOutZ] = Z, hInfo[h][SpawnOutAngle] = (180.0 + Angle);
  1003. hInfo[h][SpawnWorld] = world, hInfo[h][SpawnInterior] = interior;
  1004. new INI:file = INI_Open(HouseFile(h));
  1005. INI_WriteFloat(file, "SpawnOutX", X);
  1006. INI_WriteFloat(file, "SpawnOutY", Y);
  1007. INI_WriteFloat(file, "SpawnOutZ", Z);
  1008. INI_WriteFloat(file, "SpawnOutAngle", Angle);
  1009. INI_WriteInt(file, "SpawnWorld", world);
  1010. INI_WriteInt(file, "SpawnInterior", interior);
  1011. INI_Close(file);
  1012. ShowInfoBox(playerid, I_HSPAWN_CHANGED, h);
  1013. }
  1014. return 1;
  1015. }
  1016. //==============================================================================
  1017. // This command is used to change the spawnposition details of a house interior
  1018. //==============================================================================
  1019. CMD:changehintspawn(playerid, params[])
  1020. {
  1021. new hint, filename[HOUSEFILE_LENGTH];
  1022. if(!IsPlayerAdmin(playerid)) return 0;
  1023. if(sscanf(params, "d", hint)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CHANGEHINTSPAWN);
  1024. format(filename, sizeof(filename), HINT_FILEPATH, hint);
  1025. if(!fexist(filename)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HINT_ID);
  1026. else
  1027. {
  1028. GetPlayerPos(playerid, X, Y, Z);
  1029. GetPlayerFacingAngle(playerid, Angle);
  1030. hIntInfo[hint][IntSpawnX] = X, hIntInfo[hint][IntSpawnY] = Y, hIntInfo[hint][IntSpawnZ] = Z, hIntInfo[hint][IntInterior] = GetPlayerInterior(playerid);
  1031. hIntInfo[hint][IntSpawnAngle] = (Angle + 180.0);
  1032. new INI:file = INI_Open(filename);
  1033. INI_WriteFloat(file, "SpawnX", X);
  1034. INI_WriteFloat(file, "SpawnY", Y);
  1035. INI_WriteFloat(file, "SpawnZ", Z);
  1036. INI_WriteFloat(file, "Angle", hIntInfo[hint][IntSpawnAngle]);
  1037. INI_WriteInt(file, "Interior", hIntInfo[hint][IntInterior]);
  1038. INI_Close(file);
  1039. ShowInfoBox(playerid, I_HINT_SPAWN_CHANGED, hint);
  1040. }
  1041. return 1;
  1042. }
  1043. //==============================================================================
  1044. // This command is used to create a house interior.
  1045. //==============================================================================
  1046. CMD:createhint(playerid, params[])
  1047. {
  1048. new filename[HOUSEFILE_LENGTH], h = GetFreeInteriorID(), value, name[31], interior = GetPlayerInterior(playerid);
  1049. if(!IsPlayerAdmin(playerid)) return 0;
  1050. if(sscanf(params, "ds[30]", value, name)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CREATEHINT);
  1051. if(h < 0)
  1052. {
  1053. ShowInfoBox(playerid, E_TOO_MANY_HINTS, MAX_HOUSE_INTERIORS);
  1054. return 1;
  1055. }
  1056. if(value < MIN_HINT_VALUE || value > MAX_HINT_VALUE) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HINT_VALUE);
  1057. if(name[30]) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HINT_LENGTH);
  1058. else
  1059. {
  1060. format(filename, sizeof(filename), HINT_FILEPATH, h);
  1061. fcreate(filename);
  1062. GetPlayerPos(playerid, X, Y, Z);
  1063. GetPlayerFacingAngle(playerid, Angle);
  1064. hIntInfo[h][IntCPX] = X, hIntInfo[h][IntCPY] = Y, hIntInfo[h][IntCPZ] = Z;
  1065. hIntInfo[h][IntInterior] = interior, hIntInfo[h][IntSpawnAngle] = (Angle + 180.0), format(hIntInfo[h][IntName], 30, "%s", name), hIntInfo[h][IntValue] = value;
  1066. new INI:file = INI_Open(filename);
  1067. INI_WriteFloat(file, "CPX", X);
  1068. INI_WriteFloat(file, "CPY", Y);
  1069. INI_WriteFloat(file, "CPZ", Z);
  1070. INI_WriteString(file, "Name", name);
  1071. INI_WriteInt(file, "Value", value);
  1072. GetPosInFrontOfPlayer(playerid, X, Y, -2.5);
  1073. INI_WriteFloat(file, "SpawnX", X);
  1074. INI_WriteFloat(file, "SpawnY", Y);
  1075. INI_WriteFloat(file, "SpawnZ", Z);
  1076. INI_WriteFloat(file, "Angle", hIntInfo[h][IntSpawnAngle]);
  1077. INI_WriteInt(file, "Interior", interior);
  1078. INI_Close(file);
  1079. hIntInfo[h][IntSpawnX] = X, hIntInfo[h][IntSpawnY] = Y, hIntInfo[h][IntSpawnZ] = Z;
  1080. ShowInfoBox(playerid, I_HINT_CREATED, h, value, name);
  1081. }
  1082. return 1;
  1083. }
  1084. //==============================================================================
  1085. // This command is used to remove a house interior.
  1086. //==============================================================================
  1087. CMD:removehint(playerid, params[])
  1088. {
  1089. new hint, filename[HOUSEFILE_LENGTH];
  1090. if(!IsPlayerAdmin(playerid)) return 0;
  1091. if(sscanf(params, "d", hint)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_REMOVEHINT);
  1092. format(filename, sizeof(filename), HINT_FILEPATH, hint);
  1093. if(!fexist(filename)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HINT);
  1094. ShowInfoBox(playerid, I_HINT_DESTROYED, hint);
  1095. fremove(filename);
  1096. foreach(Houses, h)
  1097. {
  1098. if(hInfo[h][HouseInterior] == hint)
  1099. {
  1100. hInfo[h][HouseInterior] = DEFAULT_H_INTERIOR;
  1101. new INI:file = INI_Open(HouseFile(h));
  1102. INI_WriteInt(file, "HouseInterior", DEFAULT_H_INTERIOR);
  1103. INI_Close(file);
  1104. }
  1105. }
  1106. return 1;
  1107. }
  1108. //==============================================================================
  1109. // This command is used to teleport to a house.
  1110. //==============================================================================
  1111. CMD:gotohouse(playerid, params[])
  1112. {
  1113. new h;
  1114. if(!IsPlayerAdmin(playerid)) return 0;
  1115. if(sscanf(params, "d", h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_GOTOHOUSE);
  1116. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  1117. SetPlayerPosEx(playerid, hInfo[h][SpawnOutX], hInfo[h][SpawnOutY], hInfo[h][SpawnOutZ], hInfo[h][SpawnInterior], hInfo[h][SpawnWorld]);
  1118. ShowInfoBox(playerid, I_TELEPORT_MSG, h);
  1119. return 1;
  1120. }
  1121. //==============================================================================
  1122. // This command is used to sell a house.
  1123. // If the house owner is connected while selling the house,
  1124. // the amount in the house storage and 75% of the house value will be given to the house owner.
  1125. //==============================================================================
  1126. CMD:sellhouse(playerid, params[])
  1127. {
  1128. new h;
  1129. if(!IsPlayerAdmin(playerid)) return 0;
  1130. if(sscanf(params, "d", h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_SELLHOUSE);
  1131. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  1132. if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_H_A_F_SALE);
  1133. else
  1134. {
  1135. ShowInfoBox(playerid, I_H_SOLD, h);
  1136. if(hInfo[h][HouseStorage] >= 1 && IsPlayerConnected(GetHouseOwnerEx(h)))
  1137. {
  1138. GivePlayerMoney(playerid, (hInfo[h][HouseStorage] + ReturnProcent(hInfo[h][HouseValue], HOUSE_SELLING_PROCENT)));
  1139. }
  1140. hInfo[h][HouseValue] = ReturnProcent(hInfo[h][HouseValue], HOUSE_SELLING_PROCENT);
  1141. format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", INVALID_HOWNER_NAME);
  1142. hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
  1143. format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", DEFAULT_HOUSE_NAME);
  1144. hInfo[h][HouseStorage] = hInfo[h][HouseAlarm] = hInfo[h][HouseDog] = hInfo[h][HouseCamera] = hInfo[h][UpgradedLock] = 0;
  1145. new INI:file = INI_Open(HouseFile(h));
  1146. INI_WriteInt(file, "HouseValue", hInfo[h][HouseValue]);
  1147. INI_WriteString(file, "HouseOwner", INVALID_HOWNER_NAME);
  1148. INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
  1149. INI_WriteString(file, "HouseName", DEFAULT_HOUSE_NAME);
  1150. INI_WriteInt(file, "HouseStorage", 0);
  1151. INI_Close(file);
  1152. foreach(Houses, h2)
  1153. {
  1154. if(IsHouseInRangeOfHouse(h, h2, RANGE_BETWEEN_HOUSES) && h2 != h)
  1155. {
  1156. hInfo[h2][HouseValue] = (hInfo[h2][HouseValue] - ReturnProcent(hInfo[h2][HouseValue], HOUSE_SELLING_PROCENT2));
  1157. file = INI_Open(HouseFile(h2));
  1158. INI_WriteInt(file, "HouseValue", hInfo[h2][HouseValue]);
  1159. INI_Close(file);
  1160. }
  1161. }
  1162. foreach(Player, i)
  1163. {
  1164. if(IsPlayerInHouse(i, h))
  1165. {
  1166. ExitHouse(i, h);
  1167. ShowInfoBoxEx(i, COLOUR_INFO, I_TO_PLAYERS_HSOLD);
  1168. }
  1169. }
  1170. #if GH_USE_MAPICONS == true
  1171. DestroyDynamicMapIcon(HouseMIcon[h]);
  1172. HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 31, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
  1173. #endif
  1174. UpdateHouseText(h);
  1175. }
  1176. return 1;
  1177. }
  1178. //==============================================================================
  1179. // This command is used to sell a house.
  1180. // If the house owner is connected while selling the house,
  1181. // the amount in the house storage and 75% of the house value will be given to the house owner.
  1182. //==============================================================================
  1183. CMD:sellallhouses(playerid, params[])
  1184. {
  1185. #pragma unused params
  1186. new INI:file, hcount;
  1187. if(!IsPlayerAdmin(playerid)) return 0;
  1188. else
  1189. {
  1190. foreach(Houses, h)
  1191. {
  1192. if(strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
  1193. {
  1194. if(hInfo[h][HouseStorage] >= 1 && IsPlayerConnected(GetHouseOwnerEx(h)))
  1195. {
  1196. GivePlayerMoney(playerid, (hInfo[h][HouseStorage] + ReturnProcent(hInfo[h][HouseValue], HOUSE_SELLING_PROCENT)));
  1197. }
  1198. hInfo[h][HouseValue] = ReturnProcent(hInfo[h][HouseValue], HOUSE_SELLING_PROCENT);
  1199. format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", INVALID_HOWNER_NAME);
  1200. hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
  1201. format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", DEFAULT_HOUSE_NAME);
  1202. hInfo[h][HouseStorage] = hInfo[h][HouseAlarm] = hInfo[h][HouseDog] = hInfo[h][HouseCamera] = hInfo[h][UpgradedLock] = 0;
  1203. file = INI_Open(HouseFile(h));
  1204. INI_WriteInt(file, "HouseValue", hInfo[h][HouseValue]);
  1205. INI_WriteString(file, "HouseOwner", INVALID_HOWNER_NAME);
  1206. INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
  1207. INI_WriteString(file, "HouseName", DEFAULT_HOUSE_NAME);
  1208. INI_WriteInt(file, "HouseStorage", 0);
  1209. INI_Close(file);
  1210. #if GH_USE_MAPICONS == true
  1211. DestroyDynamicMapIcon(HouseMIcon[h]);
  1212. HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 31, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
  1213. #endif
  1214. UpdateHouseText(h);
  1215. hcount++;
  1216. }
  1217. }
  1218. foreach(Player, i)
  1219. {
  1220. if(IsInHouse{i} == 1)
  1221. {
  1222. ExitHouse(i, GetPVarInt(i, "LastHouseCP"));
  1223. ShowInfoBoxEx(i, COLOUR_INFO, I_TO_PLAYERS_HSOLD);
  1224. }
  1225. }
  1226. ShowInfoBox(playerid, I_ALLH_SOLD, hcount);
  1227. }
  1228. return 1;
  1229. }
  1230. //==============================================================================
  1231. // This command is used to change the value of a house.
  1232. //==============================================================================
  1233. CMD:changeprice(playerid, params[])
  1234. {
  1235. new h, price;
  1236. if(!IsPlayerAdmin(playerid)) return 0;
  1237. if(sscanf(params, "dd", h, price)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CHANGEPRICE);
  1238. if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
  1239. if(price < MIN_HOUSE_VALUE || price > MAX_HOUSE_VALUE) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HVALUE);
  1240. hInfo[h][HouseValue] = price;
  1241. new INI:file = INI_Open(HouseFile(h));
  1242. INI_WriteInt(file, "HouseValue", price);
  1243. INI_Close(file);
  1244. ShowInfoBox(playerid, I_H_PRICE_CHANGED, h, price);
  1245. UpdateHouseText(h);
  1246. return 1;
  1247. }
  1248. //==============================================================================
  1249. // This command is used to change the value of all houses on the server.
  1250. //==============================================================================
  1251. CMD:changeallprices(playerid, params[])
  1252. {
  1253. new hcount, INI:file, price;
  1254. if(!IsPlayerAdmin(playerid)) return 0;
  1255. if(sscanf(params, "d", price)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CHANGEALLPRICE);
  1256. if(price < MIN_HOUSE_VALUE || price > MAX_HOUSE_VALUE) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HVALUE);
  1257. else
  1258. {
  1259. foreach(Houses, h)
  1260. {
  1261. hInfo[h][HouseValue] = price;
  1262. file = INI_Open(HouseFile(h));
  1263. INI_WriteInt(file, "HouseValue", price);
  1264. INI_Close(file);
  1265. UpdateHouseText(h);
  1266. hcount++;
  1267. }
  1268. ShowInfoBox(playerid, I_ALLH_PRICE_CHANGED, price, hcount);
  1269. }
  1270. return 1;
  1271. }
  1272. CMD:ghcmds(playerid, params[])
  1273. {
  1274. #pragma unused params
  1275. if(!IsPlayerAdmin(playerid)) return 0;
  1276. else return ShowPlayerDialog(playerid, HOUSEMENU-1, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, "/changeallprices\n/removeallhcars\n/sellallhouses\n/changeprice\n/changespawn\n/removehcar\n/sellhouse\n/housemenu\n/gotohouse\n/addhcar\n/changehcar\n/changehintspawn\n/createhint\n/removehint\n/ghcmds", "Close", "");
  1277. }
  1278.  
  1279. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1280. {
  1281. return 1;
  1282. }
  1283.  
  1284. public OnPlayerExitVehicle(playerid, vehicleid)
  1285. {
  1286. return 1;
  1287. }
  1288.  
  1289. #if GH_HOUSECARS == true
  1290. public OnPlayerStateChange(playerid, newstate, oldstate)
  1291. {
  1292. if(newstate == PLAYER_STATE_DRIVER)
  1293. {
  1294. foreach(Houses, h)
  1295. {
  1296. if(GetPlayerVehicleID(playerid) == HCar[h])
  1297. {
  1298. switch(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
  1299. {
  1300. case 0: ShowInfoBox(playerid, I_HOUSECAR_OWNER, pNick(playerid), h);
  1301. case 1:
  1302. {
  1303. GetPlayerPos(playerid, X, Y, Z);
  1304. SetPlayerPos(playerid, (X + 3), Y, Z);
  1305. ShowInfoBox(playerid, E_NOT_HOUSECAR_OWNER, h, hInfo[h][HouseOwner]);
  1306. }
  1307. }
  1308. break;
  1309. }
  1310. }
  1311. }
  1312. return 1;
  1313. }
  1314. #endif
  1315.  
  1316. public OnPlayerEnterCheckpoint(playerid)
  1317. {
  1318. return 1;
  1319. }
  1320.  
  1321. public OnPlayerLeaveCheckpoint(playerid)
  1322. {
  1323. return 1;
  1324. }
  1325.  
  1326. public OnPlayerEnterRaceCheckpoint(playerid)
  1327. {
  1328. return 1;
  1329. }
  1330.  
  1331. public OnPlayerLeaveRaceCheckpoint(playerid)
  1332. {
  1333. return 1;
  1334. }
  1335.  
  1336. public OnRconCommand(cmd[])
  1337. {
  1338. return 1;
  1339. }
  1340.  
  1341. public OnPlayerRequestSpawn(playerid)
  1342. {
  1343. return 1;
  1344. }
  1345.  
  1346. public OnObjectMoved(objectid)
  1347. {
  1348. return 1;
  1349. }
  1350.  
  1351. public OnPlayerObjectMoved(playerid, objectid)
  1352. {
  1353. return 1;
  1354. }
  1355.  
  1356. public OnPlayerPickUpPickup(playerid, pickupid)
  1357. {
  1358. return 1;
  1359. }
  1360.  
  1361. public OnVehicleMod(playerid, vehicleid, componentid)
  1362. {
  1363. return 1;
  1364. }
  1365.  
  1366. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1367. {
  1368. return 1;
  1369. }
  1370.  
  1371. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1372. {
  1373. return 1;
  1374. }
  1375.  
  1376. public OnPlayerSelectedMenuRow(playerid, row)
  1377. {
  1378. return 1;
  1379. }
  1380.  
  1381. public OnPlayerExitedMenu(playerid)
  1382. {
  1383. return 1;
  1384. }
  1385.  
  1386. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  1387. {
  1388. return 1;
  1389. }
  1390.  
  1391. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1392. {
  1393. return 1;
  1394. }
  1395.  
  1396. public OnRconLoginAttempt(ip[], password[], success)
  1397. {
  1398. return 1;
  1399. }
  1400.  
  1401. public OnPlayerUpdate(playerid)
  1402. {
  1403. return 1;
  1404. }
  1405.  
  1406. public OnPlayerStreamIn(playerid, forplayerid)
  1407. {
  1408. return 1;
  1409. }
  1410.  
  1411. public OnPlayerStreamOut(playerid, forplayerid)
  1412. {
  1413. return 1;
  1414. }
  1415.  
  1416. public OnVehicleStreamIn(vehicleid, forplayerid)
  1417. {
  1418. return 1;
  1419. }
  1420.  
  1421. public OnVehicleStreamOut(vehicleid, forplayerid)
  1422. {
  1423. return 1;
  1424. }
  1425. stock Float:DistanceToPoint(Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2) return Float:floatsqroot(((X2 - X1) * (X2 - X1)) + ((Y2 - Y1) * (Y2 - Y1)) + ((Z2 - Z1) * (Z2 - Z1)));
  1426.  
  1427. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1428. {
  1429. new string[400], _tmpstring[256], INI:file, filename[HOUSEFILE_LENGTH], h = GetPVarInt(playerid, "LastHouseCP"), amount = floatround(strval(inputtext));
  1430. format(filename, sizeof(filename), FILEPATH, h);
  1431. if(dialogid == HOUSEMENU && response)
  1432. {
  1433. switch(listitem)
  1434. {
  1435. case 0: ShowPlayerDialog(playerid, HOUSEMENU+19, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Set House For Sale\nCancel Active House Sale\nSell House", "Select", "Cancel");
  1436. case 1:
  1437. {
  1438. #if GH_USE_HOUSESTORAGE == false
  1439. ShowInfoBoxEx(playerid, COLOUR_INFO, E_NO_HOUSESTORAGE);
  1440. #else
  1441. #if GH_USE_WEAPONSTORAGE == true
  1442. ShowPlayerDialog(playerid, HOUSEMENU+18, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Money Storage\nWeapon Storage", "Select", "Cancel");
  1443. #else
  1444. ShowPlayerDialog(playerid, HOUSEMENU+10, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Deposit Money\nWithdraw Money\nCheck Balance", "Select", "Cancel");
  1445. #endif
  1446. #endif
  1447. }
  1448. case 2: ShowPlayerDialog(playerid, HOUSEMENU+14, DIALOG_STYLE_INPUT, INFORMATION_HEADER, "Type In The New House Name Below:\n\nPress 'Cancel' To Cancel", "Done", "Cancel");
  1449. case 3: ShowPlayerDialog(playerid, HOUSEMENU+13, DIALOG_STYLE_INPUT, INFORMATION_HEADER, "Type In The New House Password Below:\nLeave The Box Empty If You Want To Keep Your Current House Password.\nPress 'Remove' To Remove The House Password.", "Done", "Remove");
  1450. case 4:
  1451. {
  1452. #if GH_HINTERIOR_UPGRADE == true
  1453. ShowPlayerDialog(playerid, HOUSEMENU+16, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Preview House Interior\nBuy House Interior", "Select", "Cancel");
  1454. #else
  1455. ShowPlayerDialog(playerid, HOUSEMENU+24, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Open House For Visitors\nClose House For Visitors", "Select", "Cancel");
  1456. #endif
  1457. }
  1458. case 5:
  1459. {
  1460. #if GH_HINTERIOR_UPGRADE == true
  1461. ShowPlayerDialog(playerid, HOUSEMENU+24, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Open House For Visitors\nClose House For Visitors", "Select", "Cancel");
  1462. #else
  1463. new tmpcount = 1, total = (CountPlayersInHouse(h) - 1);
  1464. if(CountPlayersInHouse(h) == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NONE_IN_HOUSE);
  1465. CMDSString = "";
  1466. foreach(Player, i)
  1467. {
  1468. if(!IsPlayerInHouse(i, h)) continue;
  1469. if(playerid == i) continue;
  1470. if(tmpcount == total)
  1471. {
  1472. format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s in %s", tmpcount, pNick(i), i);
  1473. }
  1474. else format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s (%d)\n", tmpcount, pNick(i), i);
  1475. strcat(CMDSString, _tmpstring);
  1476. tmpcount++;
  1477. }
  1478. ShowPlayerDialog(playerid, HOUSEMENU+25, DIALOG_STYLE_LIST, INFORMATION_HEADER, CMDSString, "Select", "Cancel");
  1479. #endif
  1480. }
  1481. case 6:
  1482. {
  1483. #if GH_HINTERIOR_UPGRADE == true
  1484. new tmpcount = 1, total = (CountPlayersInHouse(h) - 1);
  1485. if(CountPlayersInHouse(h) == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NONE_IN_HOUSE);
  1486. CMDSString = "";
  1487. foreach(Player, i)
  1488. {
  1489. if(!IsPlayerInHouse(i, h)) continue;
  1490. if(playerid == i) continue;
  1491. if(tmpcount == total)
  1492. {
  1493. format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s in %s", tmpcount, pNick(i), i);
  1494. }
  1495. else format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s (%d)\n", tmpcount, pNick(i), i);
  1496. strcat(CMDSString, _tmpstring);
  1497. tmpcount++;
  1498. }
  1499. ShowPlayerDialog(playerid, HOUSEMENU+25, DIALOG_STYLE_LIST, INFORMATION_HEADER, CMDSString, "Select", "Cancel");
  1500. #else
  1501. ShowPlayerDialog(playerid, HOUSEMENU+27, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House Alarm\t\t$"#HUPGRADE_ALARM"\nBuy Security Camera\t\t$"#HUPGRADE_CAMERA"\nBuy House Security Dog\t$"#HUPGRADE_DOG"\nBuy Better Houselock\t\t$"#HUPGRADE_UPGRADED_HLOCK"", "Select", "Cancel");
  1502. #endif
  1503. }
  1504. case 7: ShowPlayerDialog(playerid, HOUSEMENU+27, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House Alarm\t\t$"#HUPGRADE_ALARM"\nBuy Security Camera\t\t$"#HUPGRADE_CAMERA"\nBuy House Security Dog\t$"#HUPGRADE_DOG"\nBuy Better Houselock\t\t$"#HUPGRADE_UPGRADED_HLOCK"", "Select", "Cancel");
  1505. }
  1506. return 1;
  1507. }
  1508. //------------------------------------------------------------------------------
  1509. // House Sale
  1510. //------------------------------------------------------------------------------
  1511. if(dialogid == HOUSEMENU+3 && response)
  1512. {
  1513. if(GetOwnedHouses(playerid) == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NO_HOUSES_OWNED);
  1514. else
  1515. {
  1516. new procent = ReturnProcent(hInfo[h][HouseValue], HOUSE_SELLING_PROCENT);
  1517. GivePlayerMoney(playerid, procent);
  1518. if(hInfo[h][HouseStorage] >= 1)
  1519. {
  1520. CMDSString = "";
  1521. format(_tmpstring, sizeof(_tmpstring), I_SELL_HOUSE1_1, procent);
  1522. strcat(CMDSString, _tmpstring);
  1523. format(_tmpstring, sizeof(_tmpstring), I_SELL_HOUSE1_2, (hInfo[h][HouseValue] - procent), hInfo[h][HouseStorage]);
  1524. strcat(CMDSString, _tmpstring);
  1525. ShowInfoBoxEx(playerid, COLOUR_INFO, CMDSString);
  1526. GivePlayerMoney(playerid, hInfo[h][HouseStorage]);
  1527. }
  1528. if(hInfo[h][HouseStorage] == 0)
  1529. {
  1530. ShowInfoBox(playerid, I_SELL_HOUSE2, hInfo[h][HouseName], procent, (hInfo[h][HouseValue] - procent));
  1531. }
  1532. format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", DEFAULT_HOUSE_NAME);
  1533. format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", INVALID_HOWNER_NAME);
  1534. hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
  1535. hInfo[h][HouseStorage] = hInfo[h][HouseAlarm] = hInfo[h][HouseDog] = hInfo[h][HouseCamera] = hInfo[h][UpgradedLock] = 0;
  1536. hInfo[h][HouseValue] = ReturnProcent(hInfo[h][HouseValue], HOUSE_SELLING_PROCENT);
  1537. file = INI_Open(filename);
  1538. INI_WriteInt(file, "HouseValue", hInfo[h][HouseValue]);
  1539. INI_WriteString(file, "HouseOwner", INVALID_HOWNER_NAME);
  1540. INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
  1541. INI_WriteString(file, "HouseName", DEFAULT_HOUSE_NAME);
  1542. INI_WriteInt(file, "HouseStorage", 0);
  1543. INI_Close(file);
  1544. foreach(Houses, h2)
  1545. {
  1546. if(IsHouseInRangeOfHouse(h, h2, RANGE_BETWEEN_HOUSES) && h2 != h)
  1547. {
  1548. hInfo[h2][HouseValue] = (hInfo[h2][HouseValue] - ReturnProcent(hInfo[h2][HouseValue], HOUSE_SELLING_PROCENT2));
  1549. file = INI_Open(HouseFile(h2));
  1550. INI_WriteInt(file, "HouseValue", hInfo[h2][HouseValue]);
  1551. INI_Close(file);
  1552. UpdateHouseText(h2);
  1553. }
  1554. }
  1555. foreach(Player, i)
  1556. {
  1557. if(IsPlayerInHouse(i, h))
  1558. {
  1559. ExitHouse(i, h);
  1560. ShowInfoBoxEx(i, COLOUR_INFO, I_TO_PLAYERS_HSOLD);
  1561. }
  1562. }
  1563. #if GH_USE_MAPICONS == true
  1564. DestroyDynamicMapIcon(HouseMIcon[h]);
  1565. HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 31, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
  1566. #endif
  1567. UpdateHouseText(h);
  1568. }
  1569. return 1;
  1570. }
  1571. //------------------------------------------------------------------------------
  1572. // House Buying
  1573. //------------------------------------------------------------------------------
  1574. if(dialogid == HOUSEMENU+4)
  1575. {
  1576. if(response)
  1577. {
  1578. new hname[MAX_PLAYER_NAME+9];
  1579. if(GetOwnedHouses(playerid) >= MAX_HOUSES_OWNED) { ShowInfoBox(playerid, E_MAX_HOUSES_OWNED, MAX_HOUSES_OWNED, AddS(MAX_HOUSES_OWNED)); return 1; }
  1580. if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_H_ALREADY_OWNED);
  1581. if(hInfo[h][HouseValue] > GetPlayerMoney(playerid)) { ShowInfoBox(playerid, E_CANT_AFFORD_HOUSE, hInfo[h][HouseValue], GetPlayerMoney(playerid), (hInfo[h][HouseValue] - GetPlayerMoney(playerid))); return 1; }
  1582. else
  1583. {
  1584. format(hname, sizeof(hname), "%s's House", pNick(playerid));
  1585. format(hInfo[h][HouseName], sizeof(hname), "%s", hname);
  1586. format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", pNick(playerid));
  1587. hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
  1588. hInfo[h][HouseStorage] = 0;
  1589. GivePlayerMoney(playerid, -hInfo[h][HouseValue]);
  1590. file = INI_Open(filename);
  1591. INI_WriteString(file, "HouseOwner", pNick(playerid));
  1592. INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
  1593. INI_WriteString(file, "HouseName", hname);
  1594. INI_WriteInt(file, "HouseStorage", 0);
  1595. INI_Close(file);
  1596. ShowInfoBox(playerid, I_BUY_HOUSE, hInfo[h][HouseValue]);
  1597. foreach(Houses, h2)
  1598. {
  1599. if(IsHouseInRangeOfHouse(h, h2, RANGE_BETWEEN_HOUSES) && h2 != h)
  1600. {
  1601. file = INI_Open(HouseFile(h2));
  1602. INI_WriteInt(file, "HouseValue", (hInfo[h2][HouseValue] + ReturnProcent(hInfo[h2][HouseValue], HOUSE_SELLING_PROCENT2)));
  1603. UpdateHouseText(h2);
  1604. INI_Close(file);
  1605. }
  1606. }
  1607. #if GH_USE_MAPICONS == true
  1608. DestroyDynamicMapIcon(HouseMIcon[h]);
  1609. HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 32, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
  1610. #endif
  1611. UpdateHouseText(h);
  1612. }
  1613. }
  1614. return 1;
  1615. }
  1616. //------------------------------------------------------------------------------
  1617. // House Password
  1618. //------------------------------------------------------------------------------
  1619. if(dialogid == HOUSEMENU+13)
  1620. {
  1621. if(response)
  1622. {
  1623. if(strlen(inputtext) > MAX_HOUSE_PASSWORD || (strlen(inputtext) < MIN_HOUSE_PASSWORD && strlen(inputtext) >= 1)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HPASS_LENGTH);
  1624. if(!strcmp(inputtext, "INVALID_HOUSE_PASSWORD", CASE_SENSETIVE)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HPASS);
  1625. if(strfind(inputtext, "%", CASE_SENSETIVE) != -1 || strfind(inputtext, "~", CASE_SENSETIVE) != -1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HPASS_CHARS);
  1626. else
  1627. {
  1628. if(strlen(inputtext) >= 1)
  1629. {
  1630. hInfo[h][HousePassword] = udb_hash(inputtext);
  1631. file = INI_Open(filename);
  1632. INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
  1633. INI_Close(file);
  1634. ShowInfoBox(playerid, I_HPASSWORD_CHANGED, inputtext);
  1635. }
  1636. else ShowInfoBoxEx(playerid, COLOUR_INFO, I_HPASS_NO_CHANGE);
  1637. }
  1638. }
  1639. if(!response)
  1640. {
  1641. file = INI_Open(filename);
  1642. INI_WriteInt(file, "HousePassword", udb_hash("INVALID_HOUSE_PASSWORD"));
  1643. INI_Close(file);
  1644. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HPASS_REMOVED);
  1645. }
  1646. return 1;
  1647. }
  1648. //------------------------------------------------------------------------------
  1649. // House Name
  1650. //------------------------------------------------------------------------------
  1651. if(dialogid == HOUSEMENU+14)
  1652. {
  1653. if(response)
  1654. {
  1655. if(strfind(inputtext, "%", CASE_SENSETIVE) != -1 || strfind(inputtext, "~", CASE_SENSETIVE) != -1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HNAME_CHARS);
  1656. if(strlen(inputtext) < MIN_HOUSE_NAME || strlen(inputtext) > MAX_HOUSE_NAME) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HNAME_LENGTH);
  1657. else
  1658. {
  1659. format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", inputtext);
  1660. file = INI_Open(filename);
  1661. INI_WriteString(file, "HouseName", inputtext);
  1662. INI_Close(file);
  1663. ShowInfoBox(playerid, I_HNAME_CHANGED, inputtext);
  1664. UpdateHouseText(h);
  1665. }
  1666. }
  1667. return 1;
  1668. }
  1669. //------------------------------------------------------------------------------
  1670. // House Interior Upgrade
  1671. //------------------------------------------------------------------------------
  1672. if(dialogid == HOUSEMENU+15 && response)
  1673. {
  1674. new _int = hInfo[h][HouseInterior];
  1675. SetPVarInt(playerid, "OldHouseInt", _int);
  1676. Loop(hint, MAX_HOUSE_INTERIORS, 0)
  1677. {
  1678. if(hint == listitem)
  1679. {
  1680. SetPVarInt(playerid, "HousePrevInt", hint), SetPVarInt(playerid, "HousePrevValue", hIntInfo[hint][IntValue]), SetPVarString(playerid, "HousePrevName", hIntInfo[hint][IntName]);
  1681. }
  1682. }
  1683. if(_int == GetPVarInt(playerid, "HousePrevInt")) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_ALREADY_HAVE_HINTERIOR);
  1684. else
  1685. {
  1686. new hprevvalue = GetPVarInt(playerid, "HousePrevValue");
  1687. GetPVarString(playerid, "HousePrevName", string, 50);
  1688. //------------------------------------------------------------------------------
  1689. switch(GetPVarInt(playerid, "HouseIntUpgradeMod"))
  1690. {
  1691. case 1:
  1692. {
  1693. if(GetSecondsBetweenAction(GetPVarInt(playerid, "HousePrevTime")) < (TIME_BETWEEN_VISITS * 60000) && GetPVarInt(playerid, "HousePrevTime") != 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_HINT_WAIT_BEFORE_VISITING);
  1694. SetPVarInt(playerid, "IsHouseVisiting", 1);
  1695. SetPVarInt(playerid, "HousePreview", 1);
  1696. SetPVarInt(playerid, "ChangeHouseInt", 1);
  1697. SetPVarInt(playerid, "HousePrevTime", GetTickCount());
  1698. SetPVarInt(playerid, "HousePrevTimer", SetTimerEx("HouseVisiting", (MAX_VISIT_TIME * 60000), false, "i", playerid));
  1699. ShowInfoBox(playerid, I_VISITING_HOUSEINT, string, hprevvalue, MAX_VISIT_TIME, AddS(MAX_VISIT_TIME));
  1700.  
  1701. }
  1702. case 2:
  1703. {
  1704. if(hprevvalue > GetPlayerMoney(playerid))
  1705. {
  1706. CMDSString = "";
  1707. format(_tmpstring, sizeof(_tmpstring), E_CANT_AFFORD_HINT1, string, hprevvalue);
  1708. strcat(CMDSString, _tmpstring);
  1709. format(_tmpstring, sizeof(_tmpstring), E_CANT_AFFORD_HINT2, GetPlayerMoney(playerid), (hprevvalue - GetPlayerMoney(playerid)));
  1710. strcat(CMDSString, _tmpstring);
  1711. ShowInfoBoxEx(playerid, COLOUR_INFO, CMDSString);
  1712. }
  1713. if(hprevvalue <= GetPlayerMoney(playerid))
  1714. {
  1715. GivePlayerMoney(playerid, -hprevvalue);
  1716. SetPVarInt(playerid, "ChangeHouseInt", 1);
  1717. file = INI_Open(filename);
  1718. INI_Close(file);
  1719. ShowInfoBox(playerid, I_HINT_BOUGHT, string, hprevvalue);
  1720. }
  1721. }
  1722. }
  1723. //------------------------------------------------------------------------------
  1724. if(GetPVarInt(playerid, "ChangeHouseInt") == 1)
  1725. {
  1726. hInfo[h][HouseInterior] = GetPVarInt(playerid, "HousePrevInt");
  1727. file = INI_Open(filename);
  1728. INI_WriteInt(file, "HouseInterior", hInfo[h][HouseInterior]);
  1729. INI_Close(file);
  1730. DestroyHouseEntrance(h, TYPE_INT);
  1731. CreateCorrectHouseExitCP(h);
  1732. foreach(Player, i)
  1733. {
  1734. if(GetPVarInt(i, "LastHouseCP") == h && IsInHouse{i} == 1)
  1735. {
  1736. SetPlayerHouseInterior(i, h);
  1737. }
  1738. }
  1739. DeletePVar(playerid, "ChangeHouseInt");
  1740. }
  1741. //------------------------------------------------------------------------------
  1742. }
  1743. return 1;
  1744. }
  1745. //------------------------------------------------------------------------------
  1746. // House Interior Mode Selecting
  1747. //------------------------------------------------------------------------------
  1748. #if GH_HINTERIOR_UPGRADE == true
  1749. if(dialogid == HOUSEMENU+16 && response)
  1750. {
  1751. switch(listitem)
  1752. {
  1753. case 0: SetPVarInt(playerid, "HouseIntUpgradeMod", 1);
  1754. case 1: SetPVarInt(playerid, "HouseIntUpgradeMod", 2);
  1755. }
  1756. CMDSString = "";
  1757. Loop(i, MAX_HOUSE_INTERIORS, 0)
  1758. {
  1759. format(filename, sizeof(filename), HINT_FILEPATH, i);
  1760. if(!fexist(filename)) continue;
  1761. if(i == (MAX_HOUSE_INTERIORS-1))
  1762. {
  1763. switch(strlen(hIntInfo[i][IntName]))
  1764. {
  1765. case 0..13: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t\t{00BC00}$%d", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
  1766. default: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t{00BC00}$%d", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
  1767. }
  1768. }
  1769. else
  1770. {
  1771. switch(strlen(hIntInfo[i][IntName]))
  1772. {
  1773. case 0..13: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t\t{00BC00}$%d\n", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
  1774. default: format(_tmpstring, sizeof(_tmpstring), "{00BC00}%d.\t{FFFF2A}%s\t\t{00BC00}$%d\n", (i + 1), hIntInfo[i][IntName], hIntInfo[i][IntValue]);
  1775. }
  1776. }
  1777. strcat(CMDSString, _tmpstring);
  1778. }
  1779. ShowPlayerDialog(playerid, HOUSEMENU+15, DIALOG_STYLE_LIST, INFORMATION_HEADER, CMDSString, "Buy", "Cancel");
  1780. return 1;
  1781. }
  1782. #endif
  1783. //------------------------------------------------------------------------------
  1784. // House Interior Upgrade
  1785. //------------------------------------------------------------------------------
  1786. #if GH_HINTERIOR_UPGRADE == true
  1787. if(dialogid == HOUSEMENU+17)
  1788. {
  1789. KillTimer(GetPVarInt(playerid, "HousePrevTimer"));
  1790. DeletePVar(playerid, "IsHouseVisiting"), DeletePVar(playerid, "HousePrevTimer");
  1791. file = INI_Open(filename);
  1792. switch(response)
  1793. {
  1794. case 0:
  1795. {
  1796. hInfo[h][HouseInterior] = GetPVarInt(playerid, "OldHouseInt");
  1797. INI_WriteInt(file, "HouseInterior", hInfo[h][HouseInterior]);
  1798. }
  1799. case 1:
  1800. {
  1801. new hprevvalue = GetPVarInt(playerid, "HousePrevValue");
  1802. GetPVarString(playerid, "HousePrevName", string, 50);
  1803. if(GetPlayerMoney(playerid) < GetPVarInt(playerid, "HousePrevValue"))
  1804. {
  1805. hInfo[h][HouseInterior] = GetPVarInt(playerid, "OldHouseInt");
  1806. INI_WriteInt(file, "HouseInterior", hInfo[h][HouseInterior]);
  1807. CMDSString = "";
  1808. format(_tmpstring, sizeof(_tmpstring), E_CANT_AFFORD_HINT1, string, hprevvalue);
  1809. strcat(CMDSString, _tmpstring);
  1810. format(_tmpstring, sizeof(_tmpstring), E_CANT_AFFORD_HINT2, GetPlayerMoney(playerid), (hprevvalue - GetPlayerMoney(playerid)));
  1811. strcat(CMDSString, _tmpstring);
  1812. ShowInfoBoxEx(playerid, COLOUR_INFO, CMDSString);
  1813. }
  1814. else
  1815. {
  1816. GivePlayerMoney(playerid, -hprevvalue);
  1817. hInfo[h][HouseInterior] = GetPVarInt(playerid, "HousePrevInt");
  1818. INI_WriteString(file, "HouseInteriorName", string);
  1819. INI_WriteInt(file, "HouseInterior", hInfo[h][HouseInterior]);
  1820. INI_WriteInt(file, "HouseInteriorValue", hprevvalue);
  1821. ShowInfoBox(playerid, I_HINT_BOUGHT, string, hprevvalue);
  1822. }
  1823. }
  1824. }
  1825. INI_Close(file);
  1826. //------------------------------------------------------------------------------
  1827. DestroyHouseEntrance(h, TYPE_INT);
  1828. CreateCorrectHouseExitCP(h);
  1829. foreach(Player, i)
  1830. {
  1831. if(GetPVarInt(i, "LastHouseCP") == h && IsInHouse{i} == 1)
  1832. {
  1833. SetPlayerHouseInterior(i, h);
  1834. }
  1835. }
  1836. SetPVarInt(playerid, "HousePreview", 0);
  1837. //------------------------------------------------------------------------------
  1838. return 1;
  1839. }
  1840. #endif
  1841. //------------------------------------------------------------------------------
  1842. // Money Storage
  1843. //------------------------------------------------------------------------------
  1844. if(dialogid == HOUSEMENU+10 && response)
  1845. {
  1846. if(listitem == 0) // Deposit
  1847. {
  1848. format(string, sizeof(string), I_HINT_DEPOSIT1, hInfo[h][HouseStorage]);
  1849. ShowPlayerDialog(playerid, HOUSEMENU+11, DIALOG_STYLE_INPUT, INFORMATION_HEADER, string, "Deposit", "Cancel");
  1850. }
  1851. if(listitem == 1) // Withdraw
  1852. {
  1853. format(string, sizeof(string), I_HINT_WITHDRAW1, hInfo[h][HouseStorage]);
  1854. ShowPlayerDialog(playerid, HOUSEMENU+12, DIALOG_STYLE_INPUT, INFORMATION_HEADER, string, "Withdraw", "Cancel");
  1855. }
  1856. if(listitem == 2) // Check Balance
  1857. {
  1858. ShowInfoBox(playerid, I_HINT_CHECKBALANCE, hInfo[h][HouseStorage]);
  1859. }
  1860. return 1;
  1861. }
  1862. //------------------------------------------------------------------------------
  1863. if(dialogid == HOUSEMENU+11 && response)
  1864. {
  1865. if(amount > GetPlayerMoney(playerid)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_ENOUGH_PMONEY);
  1866. if(amount < 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_AMOUNT);
  1867. if((hInfo[h][HouseStorage] + amount) >= 25000000) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_HSTORAGE_L_REACHED);
  1868. else
  1869. {
  1870. hInfo[h][HouseStorage] = (hInfo[h][HouseStorage] + amount);
  1871. file = INI_Open(filename);
  1872. INI_WriteInt(file, "HouseStorage", hInfo[h][HouseStorage]);
  1873. INI_Close(file);
  1874. GivePlayerMoney(playerid, -amount);
  1875. ShowInfoBox(playerid, I_HINT_DEPOSIT2, amount, hInfo[h][HouseStorage]);
  1876. }
  1877. return 1;
  1878. }
  1879. //------------------------------------------------------------------------------
  1880. if(dialogid == HOUSEMENU+12 && response)
  1881. {
  1882. if(amount > hInfo[h][HouseStorage]) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_ENOUGH_HSMONEY);
  1883. if(amount < 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_AMOUNT);
  1884. else
  1885. {
  1886. hInfo[h][HouseStorage] = (hInfo[h][HouseStorage] - amount);
  1887. file = INI_Open(filename);
  1888. INI_WriteInt(file, "HouseStorage", hInfo[h][HouseStorage]);
  1889. INI_Close(file);
  1890. GivePlayerMoney(playerid, amount);
  1891. ShowInfoBox(playerid, I_HINT_WITHDRAW2, amount, hInfo[h][HouseStorage]);
  1892. }
  1893. return 1;
  1894. }
  1895. //------------------------------------------------------------------------------
  1896. // House Sale
  1897. //------------------------------------------------------------------------------
  1898. if(dialogid == HOUSEMENU+18 && response)
  1899. {
  1900. switch(listitem)
  1901. {
  1902. case 0: ShowPlayerDialog(playerid, HOUSEMENU+10, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Deposit Money\nWithdraw Money\nCheck Balance", "Select", "Cancel");
  1903. case 1: ShowPlayerDialog(playerid, HOUSEMENU+30, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Store Your Current Weapons\nReceive House Storage Weapons", "Select", "Cancel");
  1904. }
  1905. }
  1906. //------------------------------------------------------------------------------
  1907. // Selling House
  1908. //------------------------------------------------------------------------------
  1909. if(dialogid == HOUSEMENU+19 && response)
  1910. {
  1911. switch(listitem)
  1912. {
  1913. case 0: ShowPlayerDialog(playerid, HOUSEMENU+20, DIALOG_STYLE_INPUT, INFORMATION_HEADER, HMENU_SELL_HOUSE2, "Select", "Cancel");
  1914. case 1: ShowPlayerDialog(playerid, HOUSEMENU+21, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, HMENU_HSALE_CANCEL, "Remove", "Cancel");
  1915. case 2:
  1916. {
  1917. format(string, sizeof(string), HMENU_SELL_HOUSE, hInfo[h][HouseName], ReturnProcent(hInfo[h][HouseValue], HOUSE_SELLING_PROCENT));
  1918. ShowPlayerDialog(playerid, HOUSEMENU+3, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Sell", "Cancel");
  1919. }
  1920. }
  1921. return 1;
  1922. }
  1923. //------------------------------------------------------------------------------
  1924. // Selling House
  1925. //------------------------------------------------------------------------------
  1926. if(dialogid == HOUSEMENU+20 && response)
  1927. {
  1928. if(amount < MIN_HOUSE_VALUE || amount > MAX_HOUSE_VALUE) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HSELL_AMOUNT);
  1929. else
  1930. {
  1931. hInfo[h][ForSalePrice] = amount;
  1932. hInfo[h][ForSale] = 1;
  1933. file = INI_Open(filename);
  1934. INI_WriteInt(file, "ForSale", 1);
  1935. INI_WriteInt(file, "ForSalePrice", amount);
  1936. INI_Close(file);
  1937. ShowInfoBox(playerid, I_H_SET_FOR_SALE, hInfo[h][HouseName], amount);
  1938. UpdateHouseText(h);
  1939. }
  1940. return 1;
  1941. }
  1942. //------------------------------------------------------------------------------
  1943. // Cancelling House Sale
  1944. //------------------------------------------------------------------------------
  1945. if(dialogid == HOUSEMENU+21 && response)
  1946. {
  1947. if(hInfo[h][ForSale] != 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_H_NOT_FOR_SALE);
  1948. else
  1949. {
  1950. hInfo[h][ForSalePrice] = 0;
  1951. hInfo[h][ForSale] = 0;
  1952. file = INI_Open(filename);
  1953. INI_WriteInt(file, "ForSale", 0);
  1954. INI_WriteInt(file, "ForSalePrice", 0);
  1955. INI_Close(file);
  1956. ShowInfoBoxEx(playerid, COLOUR_INFO, HMENU_CANCEL_HOUSE_SALE);
  1957. UpdateHouseText(h);
  1958. }
  1959. return 1;
  1960. }
  1961. //------------------------------------------------------------------------------
  1962. // Selecting some stuff
  1963. //------------------------------------------------------------------------------
  1964. if(dialogid == HOUSEMENU+22 && response)
  1965. {
  1966. if(GetPlayerMoney(playerid) < hInfo[h][ForSalePrice]) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_ENOUGH_PMONEY);
  1967. else
  1968. {
  1969. new houseowner = GetHouseOwnerEx(h);
  1970. switch(IsPlayerConnected(houseowner))
  1971. {
  1972. case 0:
  1973. {
  1974. new filename2[50];
  1975. format(filename2, sizeof(filename2), USERPATH, hInfo[h][HouseOwner]);
  1976. if(!fexist(filename2))
  1977. {
  1978. fcreate(filename2);
  1979. }
  1980. file = INI_Open(filename2);
  1981. INI_WriteInt(file, "MoneyToGive", hInfo[h][ForSalePrice]);
  1982. INI_WriteInt(file, "MoneyToGiveHS", hInfo[h][HouseStorage]);
  1983. INI_WriteString(file, "HouseName", hInfo[h][HouseName]);
  1984. INI_WriteString(file, "HouseBuyer", pNick(playerid));
  1985. INI_Close(file);
  1986. }
  1987. case 1:
  1988. {
  1989. CMDSString = "";
  1990. format(_tmpstring, sizeof(_tmpstring), HSELLER_CONNECTED_MSG1, hInfo[h][HouseName], pNick(playerid), playerid);
  1991. strcat(CMDSString, _tmpstring);
  1992. format(_tmpstring, sizeof(_tmpstring), HSELLER_CONNECTED_MSG2, (hInfo[h][HouseStorage] + hInfo[h][ForSalePrice]), hInfo[h][HouseStorage], hInfo[h][ForSalePrice]);
  1993. strcat(CMDSString, _tmpstring);
  1994. ShowInfoBoxEx(houseowner, COLOUR_INFO, CMDSString);
  1995. GivePlayerMoney(houseowner, (hInfo[h][ForSalePrice] + hInfo[h][HouseStorage]));
  1996. }
  1997. }
  1998. GivePlayerMoney(playerid, -hInfo[h][ForSalePrice]);
  1999. format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s's House", pNick(playerid));
  2000. format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", pNick(playerid));
  2001. hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
  2002. hInfo[h][ForSale] = 0;
  2003. hInfo[h][ForSalePrice] = 0;
  2004. hInfo[h][HouseStorage] = 0;
  2005. file = INI_Open(filename);
  2006. INI_WriteString(file, "HouseOwner", pNick(playerid));
  2007. INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
  2008. INI_WriteString(file, "HouseName", hInfo[h][HouseName]);
  2009. INI_WriteInt(file, "HouseStorage", 0);
  2010. INI_WriteInt(file, "ForSale", 0);
  2011. INI_WriteInt(file, "ForSalePrice", 0);
  2012. INI_Close(file);
  2013. UpdateHouseText(h);
  2014. #if GH_USE_MAPICONS == true
  2015. DestroyDynamicMapIcon(HouseMIcon[h]);
  2016. HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 31, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
  2017. #endif
  2018. UpdateHouseText(h);
  2019. }
  2020. return 1;
  2021. }
  2022. //------------------------------------------------------------------------------
  2023. // Selecting some stuff
  2024. //------------------------------------------------------------------------------
  2025. if(dialogid == HOUSEMENU+23 && response)
  2026. {
  2027. switch(listitem)
  2028. {
  2029. case 0:
  2030. {
  2031. format(string,sizeof(string), HSELL_BUY_DIALOG, hInfo[h][HouseOwner], hInfo[h][HouseName], hInfo[h][ForSalePrice]);
  2032. ShowPlayerDialog(playerid, HOUSEMENU+22, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
  2033. }
  2034. case 1:
  2035. {
  2036. #if GH_ALLOW_BREAKIN == false
  2037. ShowInfoBoxEx(playerid, COLOUR_INFO, E_NO_HOUSE_BREAKIN);
  2038. #else
  2039. new breakintime = GetPVarInt(playerid, "TimeSinceHouseBreakin"), houseowner = GetHouseOwnerEx(h), bi_chance = random(10000);
  2040. if(GetSecondsBetweenAction(breakintime) < (TIME_BETWEEN_BREAKINS * 60000) && breakintime != 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_WAIT_BEFORE_BREAKIN);
  2041. SetPVarInt(playerid, "TimeSinceHouseBreakin", GetTickCount());
  2042. if((hInfo[h][UpgradedLock] == 0 && bi_chance < 7000) || (hInfo[h][UpgradedLock] == 1 && bi_chance < 9000))
  2043. {
  2044. if(IsPlayerConnected(houseowner))
  2045. {
  2046. switch(hInfo[h][HouseCamera])
  2047. {
  2048. case 0:
  2049. {
  2050. if(hInfo[h][HouseAlarm] == 1)
  2051. {
  2052. ShowInfoBox(houseowner, E_FAILED_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2053. }
  2054. }
  2055. case 1: ShowInfoBox(houseowner, E_FAILED_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2056. }
  2057. }
  2058. ShowInfoBox(playerid, E_FAILED_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
  2059. SecurityDog_Bite(playerid, h, 0, 1);
  2060. }
  2061. if((hInfo[h][UpgradedLock] == 0 && bi_chance >= 7000) || (hInfo[h][UpgradedLock] == 1 && bi_chance >= 9000))
  2062. {
  2063. if(IsPlayerConnected(houseowner))
  2064. {
  2065. switch(hInfo[h][HouseCamera])
  2066. {
  2067. case 0:
  2068. {
  2069. if(hInfo[h][HouseAlarm] == 1)
  2070. {
  2071. ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2072. }
  2073. }
  2074. case 1: ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2075. }
  2076. }
  2077. ShowInfoBox(playerid, I_SUCCESSFULL_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
  2078. SetPlayerHouseInterior(playerid, h);
  2079. }
  2080. #if GH_GIVE_WANTEDLEVEL == true
  2081. if((GetPlayerWantedLevel(playerid) + HBREAKIN_WL) > GH_MAX_WANTED_LEVEL)
  2082. {
  2083. SetPlayerWantedLevel(playerid, GH_MAX_WANTED_LEVEL);
  2084. }
  2085. else SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + HBREAKIN_WL));
  2086. #endif
  2087. #endif
  2088. }
  2089. case 2:
  2090. {
  2091. if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
  2092. {
  2093. format(string, sizeof(string), HMENU_ENTER_PASS, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
  2094. ShowPlayerDialog(playerid, HOUSEMENU+60, DIALOG_STYLE_INPUT, INFORMATION_HEADER, string, "Enter", "Close");
  2095. }
  2096. else SetPlayerHouseInterior(playerid, h);
  2097. }
  2098. }
  2099. return 1;
  2100. }
  2101. //------------------------------------------------------------------------------
  2102. // Selecting some stuff
  2103. //------------------------------------------------------------------------------
  2104. if(dialogid == HOUSEMENU+28 && response)
  2105. {
  2106. switch(listitem)
  2107. {
  2108. case 0:
  2109. {
  2110. if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
  2111. {
  2112. format(string,sizeof(string), HMENU_ENTER_PASS, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
  2113. ShowPlayerDialog(playerid, HOUSEMENU+60, DIALOG_STYLE_INPUT, INFORMATION_HEADER, string, "Enter", "Close");
  2114. }
  2115. }
  2116. case 1:
  2117. {
  2118. #if GH_ALLOW_BREAKIN == false
  2119. ShowInfoBoxEx(playerid, COLOUR_INFO, E_NO_HOUSE_BREAKIN);
  2120. #else
  2121. new breakintime = GetPVarInt(playerid, "TimeSinceHouseBreakin"), houseowner = GetHouseOwnerEx(h), bi_chance = random(10000);
  2122. if(GetSecondsBetweenAction(breakintime) < (TIME_BETWEEN_BREAKINS * 60000) && breakintime != 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_WAIT_BEFORE_BREAKIN);
  2123. SetPVarInt(playerid, "TimeSinceHouseBreakin", GetTickCount());
  2124. if((hInfo[h][UpgradedLock] == 0 && bi_chance < 7000) || (hInfo[h][UpgradedLock] == 1 && bi_chance < 9000))
  2125. {
  2126. if(IsPlayerConnected(houseowner))
  2127. {
  2128. switch(hInfo[h][HouseCamera])
  2129. {
  2130. case 0:
  2131. {
  2132. if(hInfo[h][HouseAlarm] == 1)
  2133. {
  2134. ShowInfoBox(houseowner, E_FAILED_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2135. }
  2136. }
  2137. case 1: ShowInfoBox(houseowner, E_FAILED_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2138. }
  2139. }
  2140. ShowInfoBox(playerid, E_FAILED_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
  2141. SecurityDog_Bite(playerid, h, 0, 1);
  2142. }
  2143. if((hInfo[h][UpgradedLock] == 0 && bi_chance >= 7000) || (hInfo[h][UpgradedLock] == 1 && bi_chance >= 9000))
  2144. {
  2145. if(IsPlayerConnected(houseowner))
  2146. {
  2147. switch(hInfo[h][HouseCamera])
  2148. {
  2149. case 0:
  2150. {
  2151. if(hInfo[h][HouseAlarm] == 1)
  2152. {
  2153. ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_2, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2154. }
  2155. }
  2156. case 1: ShowInfoBox(houseowner, I_SUCCESSFULL_BREAKIN1_1, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2157. }
  2158. }
  2159. ShowInfoBox(playerid, I_SUCCESSFULL_BREAKIN2, hInfo[h][HouseName], hInfo[h][HouseOwner]);
  2160. SetPlayerHouseInterior(playerid, h);
  2161. }
  2162. #if GH_GIVE_WANTEDLEVEL == true
  2163. if((GetPlayerWantedLevel(playerid) + HBREAKIN_WL) > GH_MAX_WANTED_LEVEL)
  2164. {
  2165. SetPlayerWantedLevel(playerid, GH_MAX_WANTED_LEVEL);
  2166. }
  2167. else SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + HBREAKIN_WL));
  2168. #endif
  2169. #endif
  2170. }
  2171. case 2: SetPlayerHouseInterior(playerid, h);
  2172. }
  2173. return 1;
  2174. }
  2175. //------------------------------------------------------------------------------
  2176. // House Privacy
  2177. //------------------------------------------------------------------------------
  2178. if(dialogid == HOUSEMENU+24 && response)
  2179. {
  2180. switch(listitem)
  2181. {
  2182. case 0: // Open
  2183. {
  2184. hInfo[h][HousePrivacy] = 1;
  2185. file = INI_Open(filename);
  2186. INI_WriteInt(file, "HousePrivacy", 1);
  2187. INI_Close(file);
  2188. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HOPEN_FOR_VISITORS);
  2189. }
  2190. case 1: // Closed
  2191. {
  2192. new count;
  2193. hInfo[h][HousePrivacy] = 0;
  2194. file = INI_Open(filename);
  2195. INI_WriteInt(file, "HousePrivacy", 0);
  2196. INI_Close(file);
  2197. foreach(Player, i)
  2198. {
  2199. if(i == playerid) continue;
  2200. if(GetPVarInt(i, "LastHouseCP") == h && IsInHouse{i} == 1)
  2201. {
  2202. ExitHouse(i, GetPVarInt(i, "LastHouseCP"));
  2203. ShowInfoBox(playerid, I_CLOSED_FOR_VISITORS2 , pNick(playerid), playerid);
  2204. count++;
  2205. }
  2206. }
  2207. ShowInfoBox(playerid, I_CLOSED_FOR_VISITORS1, count);
  2208. }
  2209. }
  2210. UpdateHouseText(h);
  2211. return 1;
  2212. }
  2213. //------------------------------------------------------------------------------
  2214. // Player Selecting - Part 1
  2215. //------------------------------------------------------------------------------
  2216. if(dialogid == HOUSEMENU+25 && response)
  2217. {
  2218. new tmpcount;
  2219. foreach(Player, i)
  2220. {
  2221. if(!IsPlayerInHouse(i, h)) continue;
  2222. if(playerid == i) continue;
  2223. if(listitem == tmpcount)
  2224. {
  2225. SetPVarInt(playerid, "ClickedPlayer", i);
  2226. break;
  2227. }
  2228. tmpcount++;
  2229. }
  2230. ShowPlayerDialog(playerid, HOUSEMENU+26, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Kick Out From House\nGive House Key\nTake House Key", "Select", "Cancel");
  2231. return 1;
  2232. }
  2233. //------------------------------------------------------------------------------
  2234. // Player Selecting - Part 2
  2235. //------------------------------------------------------------------------------
  2236. if(dialogid == HOUSEMENU+26 && response)
  2237. {
  2238. new clickedplayer = GetPVarInt(playerid, "ClickedPlayer"), _temp_[17];
  2239. switch(listitem)
  2240. {
  2241. case 0:
  2242. {
  2243. if(!IsPlayerInHouse(clickedplayer, h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_KICKED_NOT_IN_HOUSE);
  2244. ExitHouse(clickedplayer, h);
  2245. ShowInfoBox(playerid, I_KICKED_FROM_HOUSE1, pNick(clickedplayer), clickedplayer);
  2246. ShowInfoBox(clickedplayer, I_KICKED_FROM_HOUSE2, pNick(playerid), playerid);
  2247. }
  2248. case 1:
  2249. {
  2250. format(_temp_, sizeof(_temp_), "HouseKeys_%d", h);
  2251. if(GetPVarInt(clickedplayer, _temp_) == 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_ALREADY_HAVE_HOUSEKEYS);
  2252. SetPVarInt(clickedplayer, _temp_, 1);
  2253. ShowInfoBox(playerid, I_HOUSEKEYS_RECIEVED_1, pNick(clickedplayer), clickedplayer);
  2254. ShowInfoBox(clickedplayer, I_HOUSEKEYS_RECIEVED_2, hInfo[h][HouseName], hInfo[h][HouseLocation], pNick(playerid), playerid);
  2255. }
  2256. case 2:
  2257. {
  2258. format(_temp_, sizeof(_temp_), "HouseKeys_%d", h);
  2259. if(GetPVarInt(clickedplayer, _temp_) == 0) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_DOESNT_HAVE_HOUSEKEYS);
  2260. DeletePVar(clickedplayer, _temp_);
  2261. ShowInfoBox(playerid, I_HOUSEKEYS_TAKEN_1, pNick(clickedplayer), clickedplayer);
  2262. ShowInfoBox(clickedplayer, I_HOUSEKEYS_TAKEN_2, pNick(playerid), playerid, hInfo[h][HouseName], hInfo[h][HouseLocation]);
  2263. }
  2264. }
  2265. return 1;
  2266. }
  2267. //------------------------------------------------------------------------------
  2268. // House Security
  2269. //------------------------------------------------------------------------------
  2270. if(dialogid == HOUSEMENU+27 && response)
  2271. {
  2272. file = INI_Open(filename);
  2273. switch(listitem)
  2274. {
  2275. case 0: // House Alarm
  2276. {
  2277. if(hInfo[h][HouseAlarm] == 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_ALREADY_HAVE_ALARM);
  2278. if(GetPlayerMoney(playerid) < HUPGRADE_ALARM) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_ENOUGH_MONEY_ALARM);
  2279. GivePlayerMoney(playerid, -HUPGRADE_ALARM);
  2280. hInfo[h][HouseAlarm] = 1;
  2281. INI_WriteInt(file, "HouseAlarm", 1);
  2282. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HUPGRADE_ALARM);
  2283. }
  2284. case 1: // Security Camera
  2285. {
  2286. if(hInfo[h][HouseCamera] == 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_ALREADY_HAVE_CAMERA);
  2287. if(GetPlayerMoney(playerid) < HUPGRADE_CAMERA) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_ENOUGH_MONEY_CAMERA);
  2288. GivePlayerMoney(playerid, -HUPGRADE_CAMERA);
  2289. hInfo[h][HouseCamera] = 1;
  2290. INI_WriteInt(file, "HouseCamera", 1);
  2291. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HUPGRADE_CAMERA);
  2292. }
  2293. case 2: // House Security Dog
  2294. {
  2295. if(hInfo[h][HouseDog] == 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_ALREADY_HAVE_DOG);
  2296. if(GetPlayerMoney(playerid) < HUPGRADE_DOG) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_ENOUGH_MONEY_DOG);
  2297. GivePlayerMoney(playerid, -HUPGRADE_DOG);
  2298. hInfo[h][HouseDog] = 1;
  2299. INI_WriteInt(file, "HouseDog", 1);
  2300. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HUPGRADE_DOG);
  2301. }
  2302. case 3: // Better Houselock
  2303. {
  2304. if(hInfo[h][UpgradedLock] == 1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_ALREADY_HAVE_UPGRADED_HLOCK);
  2305. if(GetPlayerMoney(playerid) < HUPGRADE_UPGRADED_HLOCK) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_NOT_ENOUGH_MONEY_UPGRADED_HLOCK);
  2306. GivePlayerMoney(playerid, -HUPGRADE_UPGRADED_HLOCK);
  2307. hInfo[h][UpgradedLock] = 1;
  2308. INI_WriteInt(file, "HouseUpgradedLock", 1);
  2309. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HUPGRADE_UPGRADED_HLOCK);
  2310. }
  2311. }
  2312. INI_Close(file);
  2313. return 1;
  2314. }
  2315. //------------------------------------------------------------------------------
  2316. // Weapon Storage
  2317. //------------------------------------------------------------------------------
  2318. if(dialogid == HOUSEMENU+30 && response)
  2319. {
  2320. new tmp[9], tmp2[13], tmpcount;
  2321. switch(listitem)
  2322. {
  2323. case 0: // Store weapons
  2324. {
  2325. file = INI_Open(filename);
  2326. Loop(weap, 14, 1)
  2327. {
  2328. format(tmp, sizeof(tmp), "Weapon%d", weap);
  2329. format(tmp2, sizeof(tmp2), "Weapon%dAmmo", weap);
  2330. #if GH_SAVE_ADMINWEPS == false
  2331. if(weap == 7 || weap == 8 || weap == 9 || weap == 12) continue;
  2332. #endif
  2333. GetPlayerWeaponData(playerid, weap, hInfo[h][Weapon][weap], hInfo[h][Ammo][weap]);
  2334. if(hInfo[h][Ammo][weap] < 1 || (weap == 11 && hInfo[h][Weapon][weap] != 46)) continue;
  2335. INI_WriteInt(file, tmp, hInfo[h][Weapon][weap]);
  2336. INI_WriteInt(file, tmp2, hInfo[h][Ammo][weap]);
  2337. GivePlayerWeapon(playerid, hInfo[h][Weapon][weap], -hInfo[h][Ammo][weap]);
  2338. tmpcount++;
  2339. }
  2340. INI_Close(file);
  2341. switch(tmpcount)
  2342. {
  2343. case 0: ShowInfoBox(playerid, E_NO_WEAPONS, tmpcount);
  2344. default: ShowInfoBox(playerid, I_HS_WEAPONS1, tmpcount, AddS(tmpcount));
  2345. }
  2346. }
  2347. case 1: // Receive Weapons
  2348. {
  2349. file = INI_Open(filename);
  2350. Loop(weap, 14, 1)
  2351. {
  2352. format(tmp, sizeof(tmp), "Weapon%d", weap);
  2353. format(tmp2, sizeof(tmp2), "Weapon%dAmmo", weap);
  2354. if(hInfo[h][Ammo][weap] < 1) continue;
  2355. #if GH_SAVE_ADMINWEPS == false
  2356. if(weap == 7 || weap == 8 || weap == 9 || weap == 11 || weap == 12) continue;
  2357. #endif
  2358. GivePlayerWeapon(playerid, hInfo[h][Weapon][weap], hInfo[h][Ammo][weap]);
  2359. INI_WriteInt(file, tmp, 0);
  2360. INI_WriteInt(file, tmp2, 0);
  2361. tmpcount++;
  2362. }
  2363. INI_Close(file);
  2364. switch(tmpcount)
  2365. {
  2366. case 0: ShowInfoBoxEx(playerid, COLOUR_INFO, E_NO_HS_WEAPONS);
  2367. default: ShowInfoBox(playerid, I_HS_WEAPONS2, tmpcount, AddS(tmpcount));
  2368. }
  2369. }
  2370. }
  2371. }
  2372. //------------------------------------------------------------------------------
  2373. // /myhouse House Selecting - Part 1
  2374. //------------------------------------------------------------------------------
  2375. if(dialogid == (HOUSEMENU+50) && response)
  2376. {
  2377. SetPVarInt(playerid, "ClickedHouse", ReturnPlayerHouseID(playerid, (listitem + 1)));
  2378. #if GH_ALLOW_HOUSETELEPORT == true
  2379. ShowPlayerDialog(playerid, HOUSEMENU+51, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Show Information\nTeleport To This House", "Select", "Cancel");
  2380. #else
  2381. ShowPlayerDialog(playerid, HOUSEMENU+51, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Show Information", "Select", "Cancel");
  2382. #endif
  2383. return 1;
  2384. }
  2385. //------------------------------------------------------------------------------
  2386. // /myhouse House Selecting - Part 2
  2387. //------------------------------------------------------------------------------
  2388. if(dialogid == (HOUSEMENU+51) && response)
  2389. {
  2390. new _h = GetPVarInt(playerid, "ClickedHouse");
  2391. switch(listitem)
  2392. {
  2393. case 0:
  2394. {
  2395. GetPlayerPos(playerid, X, Y, Z);
  2396. CMDSString = "";
  2397. format(_tmpstring, sizeof(_tmpstring), I_HOWNER_HINFO_1, hInfo[_h][HouseName], hInfo[_h][HouseLocation], DistanceToPoint(X, Y, Z, hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ]));
  2398. strcat(CMDSString, _tmpstring);
  2399. format(_tmpstring, sizeof(_tmpstring), I_HOWNER_HINFO_2, hInfo[_h][HouseValue], hInfo[_h][HouseStorage], Answer(hInfo[_h][HousePrivacy], "Open For Public", "Closed For Public"), _h);
  2400. strcat(CMDSString, _tmpstring);
  2401. ShowInfoBoxEx(playerid, COLOUR_INFO, CMDSString);
  2402. }
  2403. case 1: SetPlayerHouseInterior(playerid, _h);
  2404. }
  2405. return 1;
  2406. }
  2407. //------------------------------------------------------------------------------
  2408. // Enter House Using Password
  2409. //------------------------------------------------------------------------------
  2410. if(dialogid == HOUSEMENU+60)
  2411. {
  2412. if(response)
  2413. {
  2414. new _tmp_ = GetHouseOwnerEx(h);
  2415. if(strfind(inputtext, "%", CASE_SENSETIVE) != -1 || strfind(inputtext, "~", CASE_SENSETIVE) != -1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HPASS_CHARS2);
  2416. if(strlen(inputtext) < MIN_HOUSE_PASSWORD || strlen(inputtext) > MAX_HOUSE_PASSWORD) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HPASS_LENGTH);
  2417. if(udb_hash(inputtext) != hInfo[h][HousePassword])
  2418. {
  2419. ShowInfoBox(playerid, I_WRONG_HPASS1, hInfo[h][HouseOwner], inputtext);
  2420. if(IsPlayerConnected(_tmp_))
  2421. {
  2422. ShowInfoBox(_tmp_, INFORMATION_HEADER, I_WRONG_HPASS2, pNick(playerid), playerid, inputtext);
  2423. }
  2424. }
  2425. else
  2426. {
  2427. ShowInfoBox(playerid, I_CORRECT_HPASS1, hInfo[h][HouseOwner], inputtext);
  2428. SetPlayerHouseInterior(playerid, h);
  2429. if(IsPlayerConnected(_tmp_))
  2430. {
  2431. ShowInfoBox(_tmp_, INFORMATION_HEADER, I_CORRECT_HPASS2, pNick(playerid), playerid, inputtext);
  2432. }
  2433. }
  2434. }
  2435. return 1;
  2436. }
  2437. return 0; // It is important to have return 0; here at the end of ALL your scripts which uses dialogs.
  2438. }
  2439.  
  2440. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  2441. {
  2442. return 1;
  2443. }
  2444. #if GH_USE_CPS == true
  2445. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  2446. {
  2447. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  2448. {
  2449. new string[256], tmpstring[50];
  2450. foreach(Houses, h)
  2451. {
  2452. if(checkpointid == HouseCPOut[h])
  2453. {
  2454. SetPVarInt(playerid, "LastHouseCP", h);
  2455. if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
  2456. {
  2457. SetPlayerHouseInterior(playerid, h);
  2458. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HMENU);
  2459. break;
  2460. }
  2461. format(tmpstring, sizeof(tmpstring), "HouseKeys_%d", h);
  2462. if(GetPVarInt(playerid, tmpstring) == 1)
  2463. {
  2464. SetPlayerHouseInterior(playerid, h);
  2465. break;
  2466. }
  2467. if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
  2468. {
  2469. if(hInfo[h][HousePassword] == udb_hash("INVALID_HOUSE_PASSWORD"))
  2470. {
  2471. switch(hInfo[h][ForSale])
  2472. {
  2473. case 0: ShowInfoBox(playerid, LABELTEXT2, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
  2474. case 1:
  2475. {
  2476. switch(hInfo[h][HousePrivacy])
  2477. {
  2478. case 0: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In", "Select", "Cancel");
  2479. case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In\nEnter House", "Select", "Cancel");
  2480. }
  2481. }
  2482. }
  2483. break;
  2484. }
  2485. if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
  2486. {
  2487. switch(hInfo[h][ForSale])
  2488. {
  2489. case 0:
  2490. {
  2491. switch(hInfo[h][HousePrivacy])
  2492. {
  2493. case 0: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nBreak In", "Select", "Cancel");
  2494. case 1: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nBreak In\nEnter House", "Select", "Cancel");
  2495. }
  2496. }
  2497. case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In\nEnter House", "Select", "Cancel");
  2498. }
  2499. break;
  2500. }
  2501. }
  2502. if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE) && hInfo[h][HouseValue] > 0 && GetPVarInt(playerid, "JustCreatedHouse") == 0)
  2503. {
  2504. format(string, sizeof(string), HMENU_BUY_HOUSE, hInfo[h][HouseValue]);
  2505. ShowPlayerDialog(playerid, HOUSEMENU+4, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
  2506. break;
  2507. }
  2508. }
  2509. if(checkpointid == HouseCPInt[h])
  2510. {
  2511. switch(GetPVarInt(playerid, "HousePreview"))
  2512. {
  2513. case 0: ExitHouse(playerid, h);
  2514. #if GH_HINTERIOR_UPGRADE == true
  2515. case 1:
  2516. {
  2517. GetPVarString(playerid, "HousePrevName", tmpstring, 50);
  2518. format(string, sizeof(string), HMENU_BUY_HINTERIOR, tmpstring, GetPVarInt(playerid, "HousePrevValue"));
  2519. ShowPlayerDialog(playerid, HOUSEMENU+17, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
  2520. }
  2521. #endif
  2522. }
  2523. break;
  2524. }
  2525. }
  2526. }
  2527. return 1;
  2528. }
  2529. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  2530. {
  2531. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPVarInt(playerid, "JustCreatedHouse") == 1)
  2532. {
  2533. foreach(Houses, h)
  2534. {
  2535. if(checkpointid == HouseCPOut[h])
  2536. {
  2537. DeletePVar(playerid, "JustCreatedHouse");
  2538. break;
  2539. }
  2540. }
  2541. }
  2542. return 1;
  2543. }
  2544. #else
  2545. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  2546. {
  2547. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  2548. {
  2549. new string[256], tmpstring[50];
  2550. foreach(Houses, h)
  2551. {
  2552. if(pickupid == HousePickupOut[h])
  2553. {
  2554. SetPVarInt(playerid, "LastHouseCP", h);
  2555. if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
  2556. {
  2557. SetPlayerHouseInterior(playerid, h);
  2558. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HMENU);
  2559. break;
  2560. }
  2561. format(tmpstring, sizeof(tmpstring), "HouseKeys_%d", h);
  2562. if(GetPVarInt(playerid, tmpstring) == 1)
  2563. {
  2564. SetPlayerHouseInterior(playerid, h);
  2565. break;
  2566. }
  2567. if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
  2568. {
  2569. if(hInfo[h][HousePassword] == udb_hash("INVALID_HOUSE_PASSWORD"))
  2570. {
  2571. switch(hInfo[h][ForSale])
  2572. {
  2573. case 0: ShowInfoBox(playerid, LABELTEXT2, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], h);
  2574. case 1:
  2575. {
  2576. switch(hInfo[h][HousePrivacy])
  2577. {
  2578. case 0: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In", "Select", "Cancel");
  2579. case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In\nEnter House", "Select", "Cancel");
  2580. }
  2581. }
  2582. }
  2583. break;
  2584. }
  2585. if(hInfo[h][HousePassword] != udb_hash("INVALID_HOUSE_PASSWORD"))
  2586. {
  2587. switch(hInfo[h][ForSale])
  2588. {
  2589. case 0:
  2590. {
  2591. switch(hInfo[h][HousePrivacy])
  2592. {
  2593. case 0: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nBreak In", "Select", "Cancel");
  2594. case 1: ShowPlayerDialog(playerid, HOUSEMENU+28, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Enter House Using Password\nBreak In\nEnter House", "Select", "Cancel");
  2595. }
  2596. }
  2597. case 1: ShowPlayerDialog(playerid, HOUSEMENU+23, DIALOG_STYLE_LIST, INFORMATION_HEADER, "Buy House (Step 1)\nBreak In\nEnter House", "Select", "Cancel");
  2598. }
  2599. break;
  2600. }
  2601. }
  2602. if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE) && hInfo[h][HouseValue] > 0 && GetPVarInt(playerid, "JustCreatedHouse") == 0)
  2603. {
  2604. format(string, sizeof(string), HMENU_BUY_HOUSE, hInfo[h][HouseValue]);
  2605. ShowPlayerDialog(playerid, HOUSEMENU+4, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
  2606. break;
  2607. }
  2608. }
  2609. if(pickupid == HousePickupInt[h])
  2610. {
  2611. switch(GetPVarInt(playerid, "HousePreview"))
  2612. {
  2613. case 0: ExitHouse(playerid, h);
  2614. #if GH_HINTERIOR_UPGRADE == true
  2615. case 1:
  2616. {
  2617. GetPVarString(playerid, "HousePrevName", tmpstring, 50);
  2618. format(string, sizeof(string), HMENU_BUY_HINTERIOR, tmpstring, GetPVarInt(playerid, "HousePrevValue"));
  2619. ShowPlayerDialog(playerid, HOUSEMENU+17, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
  2620. }
  2621. #endif
  2622. }
  2623. break;
  2624. }
  2625. }
  2626. }
  2627. return 1;
  2628. }
  2629. #endif
  2630.  
  2631.  
  2632.  
  2633.  
  2634. //##############################################################################
  2635. // Callbacks
  2636. //##############################################################################
  2637. function HouseVisiting(playerid)
  2638. {
  2639. new string[200], tmpstring[50];
  2640. GetPVarString(playerid, "HousePrevName", tmpstring, 50);
  2641. format(string, sizeof(string), I_HINT_VISIT_OVER, tmpstring, GetPVarInt(playerid, "HousePrevValue"));
  2642. ShowPlayerDialog(playerid, HOUSEMENU+17, DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, string, "Buy", "Cancel");
  2643. return 1;
  2644. }
  2645. function HouseSpawning(playerid)
  2646. {
  2647. foreach(Houses, h)
  2648. {
  2649. if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
  2650. {
  2651. if(hInfo[h][QuitInHouse] == 1)
  2652. {
  2653. SetPVarInt(playerid, "LastHouseCP", h);
  2654. SetPlayerHouseInterior(playerid, h);
  2655. #if GH_HOUSECARS == true
  2656. LoadHouseCar(h);
  2657. #endif
  2658. ShowInfoBoxEx(playerid, COLOUR_INFO, I_HMENU);
  2659. hInfo[h][QuitInHouse] = 0;
  2660. new INI:file = INI_Open(HouseFile(h));
  2661. INI_WriteInt(file, "QuitInHouse", 0);
  2662. INI_Close(file);
  2663. break;
  2664. }
  2665. }
  2666. }
  2667. SetPVarInt(playerid, "FirstSpawn", 1);
  2668. return 1;
  2669. }
  2670. function LoadHouseData(h, name[], value[])
  2671. {
  2672. if(!strcmp(name, "HouseName", true)) { format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", value); }
  2673. if(!strcmp(name, "HouseOwner", true)) { format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", value); }
  2674. if(!strcmp(name, "HouseLocation", true)) { format(hInfo[h][HouseLocation], MAX_ZONE_NAME, "%s", GetHouseLocation(h)); }
  2675. if(!strcmp(name, "HousePassword", true))
  2676. {
  2677. switch(strcmp(value, "INVALID_HOUSE_PASSWORD", true))
  2678. {
  2679. case 0: hInfo[h][HousePassword] = udb_hash(value);
  2680. case 1: hInfo[h][HousePassword] = strval(value);
  2681. }
  2682. }
  2683. if(!strcmp(name, "SpawnOutX", true)) { hInfo[h][SpawnOutX] = floatstr(value); }
  2684. if(!strcmp(name, "SpawnOutY", true)) { hInfo[h][SpawnOutY] = floatstr(value); }
  2685. if(!strcmp(name, "SpawnOutZ", true)) { hInfo[h][SpawnOutZ] = floatstr(value); }
  2686. if(!strcmp(name, "SpawnOutAngle", true)) { hInfo[h][SpawnOutAngle] = floatstr(value); }
  2687. if(!strcmp(name, "SpawnInterior", true)) { hInfo[h][SpawnInterior] = strval(value); }
  2688. if(!strcmp(name, "SpawnWorld", true)) { hInfo[h][SpawnWorld] = strval(value); }
  2689. if(!strcmp(name, "CPOutX", true)) { hInfo[h][CPOutX] = floatstr(value); }
  2690. if(!strcmp(name, "CPOutY", true)) { hInfo[h][CPOutY] = floatstr(value); }
  2691. if(!strcmp(name, "CPOutZ", true)) { hInfo[h][CPOutZ] = floatstr(value); }
  2692. if(!strcmp(name, "HouseValue", true)) { hInfo[h][HouseValue] = strval(value); }
  2693. if(!strcmp(name, "HouseStorage", true)) { hInfo[h][HouseStorage] = strval(value); }
  2694. if(!strcmp(name, "HouseInterior", true)) { hInfo[h][HouseInterior] = strval(value); }
  2695. if(!strcmp(name, "HouseWorld", true)) { hInfo[h][SpawnWorld] = strval(value); }
  2696. if(!strcmp(name, "HouseCar", true)) { hInfo[h][HouseCar] = strval(value); }
  2697. if(!strcmp(name, "HCarPosX", true)) { hInfo[h][HouseCarPosX] = floatstr(value); }
  2698. if(!strcmp(name, "HCarPosY", true)) { hInfo[h][HouseCarPosY] = floatstr(value); }
  2699. if(!strcmp(name, "HCarPosZ", true)) { hInfo[h][HouseCarPosZ] = floatstr(value); }
  2700. if(!strcmp(name, "HCarAngle", true)) { hInfo[h][HouseCarAngle] = floatstr(value); }
  2701. if(!strcmp(name, "HCarModel", true)) { hInfo[h][HouseCarModel] = strval(value); }
  2702. if(!strcmp(name, "HCarWorld", true)) { hInfo[h][HouseCarWorld] = strval(value); }
  2703. if(!strcmp(name, "HCarInt", true)) { hInfo[h][HouseCarInterior] = strval(value); }
  2704. if(!strcmp(name, "QuitInHouse", true)) { hInfo[h][QuitInHouse] = strval(value); }
  2705. if(!strcmp(name, "ForSale", true)) { hInfo[h][ForSale] = strval(value); }
  2706. if(!strcmp(name, "ForSalePrice", true)) { hInfo[h][ForSalePrice] = strval(value); }
  2707. if(!strcmp(name, "HousePrivacy", true)) { hInfo[h][HousePrivacy] = strval(value); }
  2708. if(!strcmp(name, "HouseAlarm", true)) { hInfo[h][HouseAlarm] = strval(value); }
  2709. if(!strcmp(name, "HouseCamera", true)) { hInfo[h][HouseCamera] = strval(value); }
  2710. if(!strcmp(name, "HouseDog", true)) { hInfo[h][HouseDog] = strval(value); }
  2711. if(!strcmp(name, "HouseUpgradedLock", true)) { hInfo[h][UpgradedLock] = strval(value); }
  2712. return 0;
  2713. }
  2714. function LoadHouseInteriorData(hint, name[], value[])
  2715. {
  2716. if(!strcmp(name, "Name", true)) { format(hIntInfo[hint][IntName], 30, "%s", value); }
  2717. if(!strcmp(name, "SpawnX", true)) { hIntInfo[hint][IntSpawnX] = floatstr(value); }
  2718. if(!strcmp(name, "SpawnY", true)) { hIntInfo[hint][IntSpawnY] = floatstr(value); }
  2719. if(!strcmp(name, "SpawnZ", true)) { hIntInfo[hint][IntSpawnZ] = floatstr(value); }
  2720. if(!strcmp(name, "Angle", true)) { hIntInfo[hint][IntSpawnAngle] = floatstr(value); }
  2721. if(!strcmp(name, "CPX", true)) { hIntInfo[hint][IntCPX] = floatstr(value); }
  2722. if(!strcmp(name, "CPY", true)) { hIntInfo[hint][IntCPY] = floatstr(value); }
  2723. if(!strcmp(name, "CPZ", true)) { hIntInfo[hint][IntCPZ] = floatstr(value); }
  2724. if(!strcmp(name, "Interior", true)) { hIntInfo[hint][IntInterior] = strval(value); }
  2725. if(!strcmp(name, "Value", true)) { hIntInfo[hint][IntValue] = strval(value); }
  2726. return 0;
  2727. }
  2728. function LoadUserData(playerid, name[], value[])
  2729. {
  2730. if(!strcmp(name, "MoneyToGive", true)) { GivePlayerMoney(playerid, strval(value)), SetPVarInt(playerid, "GA_TMP_HOUSEFORSALEPRICE", strval(value)); }
  2731. if(!strcmp(name, "MoneyToGiveHS", true)) { GivePlayerMoney(playerid, strval(value)), SetPVarInt(playerid, "GA_TMP_HOUSESTORAGE", strval(value)); }
  2732. if(!strcmp(name, "HouseName", true)) { SetPVarString(playerid, "GA_TMP_HOUSENAME", value); }
  2733. if(!strcmp(name, "HouseBuyer", true)) { SetPVarString(playerid, "GA_TMP_NEWHOUSEOWNER", value); }
  2734. return 0;
  2735. }
  2736. INI:currentid[](name[], value[])
  2737. {
  2738. if(!strcmp(name, "CurrentID", true)) { CurrentID = strval(value); }
  2739. return 0;
  2740. }
  2741. function SecurityDog_ClearAnimations(playerid)
  2742. {
  2743. return ClearAnimations(playerid);
  2744. }
  2745.  
  2746. //##############################################################################
  2747. // Functions
  2748. //##############################################################################
  2749. // By [03]Garsino!
  2750. //==============================================================================
  2751. // LoadHouses();
  2752. // This function is used to load the houses.
  2753. // It creates all the checkpoints, map icons and
  2754. // 3D texts for all the houses and sets the correct 3D text information.
  2755. //==============================================================================
  2756. stock LoadHouses()
  2757. {
  2758. new hcount, labeltext[250], countstart = GetTickCount(), INI:file;
  2759. LoadHouseInteriors(); // Load house interiors
  2760. Loop(h, MAX_HOUSES, 0)
  2761. {
  2762. if(fexist(HouseFile(h)))
  2763. {
  2764. INI_ParseFile(HouseFile(h), "LoadHouseData", false, true, h, true, false );
  2765. #if GH_USE_CPS == true
  2766. HouseCPOut[h] = CreateDynamicCP(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 1.5, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, 15.0);
  2767. #else
  2768. HousePickupOut[h] = CreateDynamicPickup(PICKUP_MODEL_OUT, PICKUP_TYPE, hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, 15.0);
  2769. #endif
  2770. CreateCorrectHouseExitCP(h);
  2771. if(!strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
  2772. {
  2773. format(labeltext, sizeof(labeltext), LABELTEXT1, hInfo[h][HouseName], hInfo[h][HouseValue], h);
  2774. #if GH_USE_MAPICONS == true
  2775. HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 31, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
  2776. #endif
  2777. }
  2778. if(strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE))
  2779. {
  2780. format(labeltext, sizeof(labeltext), LABELTEXT2, hInfo[h][HouseName], hInfo[h][HouseOwner], hInfo[h][HouseValue], YesNo(hInfo[h][ForSale]), Answer(hInfo[h][HousePrivacy], "Open", "Closed"), h);
  2781. #if GH_USE_MAPICONS == true
  2782. HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 32, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
  2783. #endif
  2784. }
  2785. HouseLabel[h] = CreateDynamic3DTextLabel(labeltext, COLOUR_GREEN, hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ]+0.7, TEXTLABEL_DISTANCE, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, TEXTLABEL_TESTLOS, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, TEXTLABEL_DISTANCE);
  2786. if(isnull(hIntInfo[hInfo[h][HouseInterior]][IntName]))
  2787. {
  2788. hInfo[h][HouseInterior] = DEFAULT_H_INTERIOR;
  2789. file = INI_Open(HouseFile(h));
  2790. INI_WriteInt(file, "HouseInterior", DEFAULT_H_INTERIOR);
  2791. INI_Close(file);
  2792. }
  2793. Iter_Add(Houses, h);
  2794. hcount++;
  2795. }
  2796. }
  2797. return printf("\nTotal Houses Loaded: %d. Duration: %d ms\n", hcount, (GetTickCount() - countstart));
  2798. }
  2799. //==============================================================================
  2800. // LoadHouseCar(houseid);
  2801. // This function is used to load the house car for a house.
  2802. //==============================================================================
  2803. stock LoadHouseCar(houseid)
  2804. {
  2805. #if GH_HOUSECARS == true
  2806. if(fexist(HouseFile(houseid)) && hInfo[houseid][HouseCar] == 1)
  2807. {
  2808. HCar[houseid] = CreateVehicle(hInfo[houseid][HouseCarModel], hInfo[houseid][HouseCarPosX], hInfo[houseid][HouseCarPosY], hInfo[houseid][HouseCarPosZ], hInfo[houseid][HouseCarAngle], HCAR_COLOUR1, HCAR_COLOUR2, HCAR_RESPAWN);
  2809. SetVehicleVirtualWorld(HCar[houseid], hInfo[houseid][HouseCarWorld]);
  2810. LinkVehicleToInterior(HCar[houseid], hInfo[houseid][HouseCarInterior]);
  2811. }
  2812. #endif
  2813. return 1;
  2814. }
  2815. //==============================================================================
  2816. // UnloadHouseCar(houseid);
  2817. // This function is used to the unload house car for a house.
  2818. //==============================================================================
  2819. stock UnloadHouseCar(houseid)
  2820. {
  2821. #if GH_HOUSECARS == false
  2822. #pragma unused houseid
  2823. #else
  2824. if(fexist(HouseFile(houseid)) && hInfo[houseid][HouseCar] == 1)
  2825. {
  2826. if(GetVehicleModel(HCar[houseid]) >= 400 && GetVehicleModel(HCar[houseid]) <= 611 && HCar[houseid] >= 1)
  2827. {
  2828. DestroyVehicle(HCar[houseid]);
  2829. HCar[houseid] = -1;
  2830. }
  2831. }
  2832. #endif
  2833. return 1;
  2834. }
  2835. //==============================================================================
  2836. // SaveHouseCar(houseid);
  2837. // This function is used to check if there is any vehicles
  2838. // near the housecar spawn.
  2839. //==============================================================================
  2840. stock SaveHouseCar(houseid)
  2841. {
  2842. #if GH_HOUSECARS == true
  2843. if(fexist(HouseFile(houseid)) && hInfo[houseid][HouseCar] == 1)
  2844. {
  2845. Loop(v, MAX_VEHICLES, 0)
  2846. {
  2847. if(GetVehicleModel(v) < 400 || GetVehicleModel(v) > 611 || IsVehicleOccupied(v)) continue;
  2848. GetVehiclePos(v, X, Y, Z);
  2849. if(PointInRangeOfPoint(HCAR_RANGE, X, Y, Z, hInfo[houseid][HouseCarPosX], hInfo[houseid][HouseCarPosY], hInfo[houseid][HouseCarPosZ]))
  2850. {
  2851. new INI:file = INI_Open(HouseFile(houseid));
  2852. INI_WriteInt(file, "HCarModel", GetVehicleModel(v));
  2853. INI_Close(file);
  2854. DestroyVehicle(v);
  2855. break;
  2856. }
  2857. }
  2858. }
  2859. #endif
  2860. return 1;
  2861. }
  2862. //==============================================================================
  2863. // LoadHouseInteriors();
  2864. // This function is used to load the house interior datas from the files.
  2865. //==============================================================================
  2866. stock LoadHouseInteriors()
  2867. {
  2868. new hintcount, filename[HOUSEFILE_LENGTH], countstart = GetTickCount();
  2869. Loop(hint, MAX_HOUSE_INTERIORS, 0)
  2870. {
  2871. format(filename, sizeof(filename), HINT_FILEPATH, hint);
  2872. if(fexist(filename))
  2873. {
  2874. INI_ParseFile(filename, "LoadHouseInteriorData", false, true, hint, true, false);
  2875. hintcount++;
  2876. }
  2877. }
  2878. return printf("\nTotal House Interiors Loaded: %d. Duration: %d ms\n", hintcount, (GetTickCount() - countstart));
  2879. }
  2880. //==============================================================================
  2881. // GetOwnedHouses(playerid);
  2882. // This function is used to find out how many houses a player owns
  2883. //==============================================================================
  2884. stock GetOwnedHouses(playerid)
  2885. {
  2886. new tmpcount;
  2887. foreach(Houses, h)
  2888. {
  2889. if(!strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE))
  2890. {
  2891. tmpcount++;
  2892. }
  2893. }
  2894. return tmpcount;
  2895. }
  2896. //==============================================================================
  2897. // GetHouseOwnerEx(houseid);
  2898. // This function is used to get the house owner of a house
  2899. // and return the playerid, it will return INVALID_PLAYER_ID
  2900. // if the house owner is not connected
  2901. //==============================================================================
  2902. stock GetHouseOwnerEx(houseid)
  2903. {
  2904. if(fexist(HouseFile(houseid)))
  2905. {
  2906. foreach(Character, i)
  2907. {
  2908. if(!strcmp(pNick(i), hInfo[houseid][HouseOwner], CASE_SENSETIVE))
  2909. {
  2910. return i;
  2911. }
  2912. }
  2913. }
  2914. return INVALID_PLAYER_ID;
  2915. }
  2916. //==============================================================================
  2917. // ReturnPlayerHouseID(playerid, houseslot);
  2918. // This function is used to return the house id from a players house 'slot'
  2919. // Example: ReturnPlayerHouseID(playerid, 0);
  2920. // Would return for example house ID 500.
  2921. //==============================================================================
  2922. stock ReturnPlayerHouseID(playerid, houseslot)
  2923. {
  2924. new tmpcount;
  2925. if(houseslot < 1 && houseslot > MAX_HOUSES_OWNED) return -1;
  2926. foreach(Houses, h)
  2927. {
  2928. if(!strcmp(pNick(playerid), hInfo[h][HouseOwner], CASE_SENSETIVE))
  2929. {
  2930. tmpcount++;
  2931. if(tmpcount == houseslot)
  2932. {
  2933. return h;
  2934. }
  2935. }
  2936. }
  2937. return -1;
  2938. }
  2939. //==============================================================================
  2940. // UnloadHouses();
  2941. // This function is used to unload the houses.
  2942. // It deletes all the checkpoints, map icons and 3D texts for all the houses.
  2943. //==============================================================================
  2944. stock UnloadHouses()
  2945. {
  2946. foreach(Houses, h)
  2947. {
  2948. DestroyHouseEntrance(h, TYPE_OUT);
  2949. DestroyHouseEntrance(h, TYPE_INT);
  2950. #if GH_USE_MAPICONS == true
  2951. DestroyDynamicMapIcon(HouseMIcon[h]);
  2952. #endif
  2953. DestroyDynamic3DTextLabel(HouseLabel[h]);
  2954. #if GH_HOUSECARS == true
  2955. UnloadHouseCar(h);
  2956. #endif
  2957. }
  2958. Iter_Clear(Houses);
  2959. return 1;
  2960. }
  2961. //==============================================================================
  2962. // IsHouseInRangeOfHouse(house, house2, Float:range);
  2963. // This function is used to check if a house is in range of another house
  2964. // Default range is 250.0
  2965. //==============================================================================
  2966. stock IsHouseInRangeOfHouse(house, house2, Float:range = 250.0)
  2967. {
  2968. if(fexist(HouseFile(house)) && fexist(HouseFile(house2)))
  2969. {
  2970. if(PointInRangeOfPoint(range, hInfo[house][CPOutX], hInfo[house][CPOutY], hInfo[house][CPOutZ], hInfo[house2][CPOutX], hInfo[house2][CPOutY], hInfo[house2][CPOutZ]))
  2971. {
  2972. return 1;
  2973. }
  2974. }
  2975. return 0;
  2976. }
  2977. //==============================================================================
  2978. // CreateCorrectHouseExitCP(houseid);
  2979. // This function is used to create the correct house exit checkpoint for the houseid
  2980. // based on the house interior ID
  2981. //==============================================================================
  2982. stock CreateCorrectHouseExitCP(houseid)
  2983. {
  2984. new _int = hInfo[houseid][HouseInterior];
  2985. #if GH_USE_CPS == true
  2986. HouseCPInt[houseid] = CreateDynamicCP(hIntInfo[_int][IntCPX], hIntInfo[_int][IntCPY], hIntInfo[_int][IntCPZ], 1.5, (houseid + 1000), hIntInfo[_int][IntInterior], -1, 15.0);
  2987. #else
  2988. HousePickupInt[houseid] = CreateDynamicPickup(PICKUP_MODEL_INT, PICKUP_TYPE, hIntInfo[_int][IntCPX], hIntInfo[_int][IntCPY], hIntInfo[_int][IntCPZ], (houseid + 1000), hIntInfo[_int][IntInterior], -1, 15.0);
  2989. #endif
  2990. return 1;
  2991. }
  2992. //==============================================================================
  2993. // SetPlayerHouseInterior(playerid, house);
  2994. // This function is used to set the correct house interior for a player when he enters a house or buy a new house interior.
  2995. //==============================================================================
  2996. stock SetPlayerHouseInterior(playerid, houseid)
  2997. {
  2998. new _int = hInfo[houseid][HouseInterior];
  2999. SetPVarInt(playerid, "IsInHouse", 1), IsInHouse{playerid} = 1;
  3000. SetPlayerPosEx(playerid, hIntInfo[_int][IntSpawnX], hIntInfo[_int][IntSpawnY], hIntInfo[_int][IntSpawnZ], hIntInfo[_int][IntInterior], (houseid + 1000));
  3001. SetPlayerFacingAngle(playerid, hIntInfo[_int][IntSpawnAngle]);
  3002. }
  3003. //==============================================================================
  3004. // pNick(playerid);
  3005. // Used to get the name of a player.
  3006. //==============================================================================
  3007. stock pNick(playerid)
  3008. {
  3009. new GHNick[MAX_PLAYER_NAME];
  3010. GetPlayerName(playerid, GHNick, MAX_PLAYER_NAME);
  3011. return GHNick;
  3012. }
  3013. //==============================================================================
  3014. // PointInRangeOfPoint(Float:range, Float:x2, Float:y2, Float:z2, Float:X2, Float:Y2, Float:Z2);
  3015. // Used to check if a point is in range of another point.
  3016. // Credits to whoever made this!
  3017. //==============================================================================
  3018. stock PointInRangeOfPoint(Float:range, Float:x2, Float:y2, Float:z2, Float:X2, Float:Y2, Float:Z2)
  3019. {
  3020. X2 -= x2, Y2 -= y2, Z2 -= z2;
  3021. return ((X2 * X2) + (Y2 * Y2) + (Z2 * Z2)) < (range * range);
  3022. }
  3023. //==============================================================================
  3024. // ReturnProcent(Float:amount, Float:procent);
  3025. // Used to return the procent of an value.
  3026. //==============================================================================
  3027. stock ReturnProcent(Float:amount, Float:procent) return floatround(((amount / 100) * procent));
  3028. //==============================================================================
  3029. // SetPlayerPosEx(playerid, Float:posX, Float:posY, Float:posZ, Interior = 0, World = 0);
  3030. // Used to set the position of a player with optional interiorid and worldid parameters
  3031. //==============================================================================
  3032. stock SetPlayerPosEx(playerid, Float:posX, Float:posY, Float:posZ, Interior = 0, World = 0)
  3033. {
  3034. SetPlayerVirtualWorld(playerid, World), SetPlayerInterior(playerid, Interior), SetPlayerPos(playerid, posX, posY, posZ), SetCameraBehindPlayer(playerid);
  3035. return 1;
  3036. }
  3037. //==============================================================================
  3038. // GetFreeHouseID();
  3039. // Used to get the next free house ID. Will return -1 if there is none free.
  3040. //==============================================================================
  3041. stock GetFreeHouseID()
  3042. {
  3043. Loop(h, MAX_HOUSES, 0)
  3044. {
  3045. if(!fexist(HouseFile(h)))
  3046. {
  3047. return h;
  3048. }
  3049. }
  3050. return -1;
  3051. }
  3052. //==============================================================================
  3053. // GetFreeInteriorID();
  3054. // Used to get the next free house interior ID. Will return -1 if there is none free.
  3055. //==============================================================================
  3056. stock GetFreeInteriorID()
  3057. {
  3058. new filename[INTERIORFILE_LENGTH];
  3059. Loop(hint, MAX_HOUSE_INTERIORS, 0)
  3060. {
  3061. format(filename, sizeof(filename), HINT_FILEPATH, hint);
  3062. if(!fexist(filename))
  3063. {
  3064. return hint;
  3065. }
  3066. }
  3067. return -1;
  3068. }
  3069. //==============================================================================
  3070. // GetTotalHouses();
  3071. // Used to get the amount of existing houses.
  3072. //==============================================================================
  3073. stock GetTotalHouses() return Iter_Count(Houses);
  3074. //==============================================================================
  3075. // IsHouseInteriorValid(houseinterior);
  3076. // Used to check if a house interior does exist.
  3077. //==============================================================================
  3078. stock IsHouseInteriorValid(houseinterior)
  3079. {
  3080. new filename[INTERIORFILE_LENGTH];
  3081. format(filename, sizeof(filename), HINT_FILEPATH, houseinterior);
  3082. return fexist(filename);
  3083. }
  3084. //==============================================================================
  3085. // UpdateHouseText();
  3086. // Updates the 3D text label.
  3087. //==============================================================================
  3088. stock UpdateHouseText(houseid)
  3089. {
  3090. new labeltext[250];
  3091. if(fexist(HouseFile(houseid)))
  3092. {
  3093. switch(strcmp(INVALID_HOWNER_NAME, hInfo[houseid][HouseOwner], CASE_SENSETIVE))
  3094. {
  3095. case 0: format(labeltext, sizeof(labeltext), LABELTEXT1, hInfo[houseid][HouseName], hInfo[houseid][HouseValue], houseid);
  3096. case 1: format(labeltext, sizeof(labeltext), LABELTEXT2, hInfo[houseid][HouseName], hInfo[houseid][HouseOwner], hInfo[houseid][HouseValue], YesNo(hInfo[houseid][ForSale]), Answer(hInfo[houseid][HousePrivacy], "Open", "Closed"), houseid);
  3097. }
  3098. UpdateDynamic3DTextLabelText(HouseLabel[houseid], COLOUR_GREEN, labeltext);
  3099. }
  3100. }
  3101. //==============================================================================
  3102. // AddS(amount);
  3103. // By [03]Garsino.
  3104. //==============================================================================
  3105. stock AddS(amount)
  3106. {
  3107. new returnstring[2];
  3108. format(returnstring, 2, "");
  3109. if(amount != 1 && amount != -1)
  3110. {
  3111. format(returnstring, 2, "s");
  3112. }
  3113. return returnstring;
  3114. }
  3115. //==============================================================================
  3116. // GetSecondsBetweenAction(action);
  3117. // By [03]Garsino.
  3118. //==============================================================================
  3119. stock GetSecondsBetweenAction(action) return floatround(floatdiv((GetTickCount() - action), 1000), floatround_tozero);
  3120. //==============================================================================
  3121. // DestroyHouseEntrance(houseid, type);
  3122. // Destroys the house entrance of a house (pickup or checkpoint).
  3123. // Type can be: TYPE_OUT (0) and TYPE_INT (1)
  3124. // By [03]Garsino.
  3125. //==============================================================================
  3126. stock DestroyHouseEntrance(houseid, type)
  3127. {
  3128. #if GH_USE_CPS == true
  3129. if(type == TYPE_OUT) { DestroyDynamicCP(HouseCPOut[houseid]); }
  3130. if(type == TYPE_INT) { DestroyDynamicCP(HouseCPInt[houseid]); }
  3131. #else
  3132. if(type == TYPE_OUT) { DestroyDynamicPickup(HousePickupOut[houseid]); }
  3133. if(type == TYPE_INT) { DestroyDynamicPickup(HousePickupInt[houseid]); }
  3134. #endif
  3135. return 1;
  3136. }
  3137. //==============================================================================
  3138. // IsVehicleOccupied(vehicleid);
  3139. // Checks if a vehicle is occupied or not.
  3140. // By [03]Garsino.
  3141. //==============================================================================
  3142. stock IsVehicleOccupied(vehicleid)
  3143. {
  3144. foreach(Player, i)
  3145. {
  3146. if(IsPlayerInVehicle(i, vehicleid))
  3147. {
  3148. return 1;
  3149. }
  3150. }
  3151. return 0;
  3152. }
  3153. //==============================================================================
  3154. stock CountPlayersInHouse(houseid)
  3155. {
  3156. new count;
  3157. foreach(Player, i)
  3158. {
  3159. if(!IsPlayerInHouse(i, houseid)) continue;
  3160. count++;
  3161. }
  3162. return count;
  3163. }
  3164. stock ShowInfoBoxEx(playerid, colour, message[])
  3165. {
  3166. new HugeAssString[1000];
  3167. format(HugeAssString, sizeof(HugeAssString), "{%06x}%s", (colour >>> 8), message);
  3168. return ShowPlayerDialog(playerid, (HOUSEMENU-1), DIALOG_STYLE_MSGBOX, INFORMATION_HEADER, HugeAssString, "Close", "");
  3169. }
  3170. stock DeletePVars(playerid)
  3171. {
  3172. DeletePVar(playerid, "LastHouseCP"), DeletePVar(playerid, "IsInHouse"), DeletePVar(playerid, "FirstSpawn");
  3173. DeletePVar(playerid, "GA_TMP_HOUSESTORAGE"), DeletePVar(playerid, "GA_TMP_NEWHOUSEOWNER"), DeletePVar(playerid, "GA_TMP_HOUSEFORSALEPRICE"), DeletePVar(playerid, "GA_TMP_HOUSENAME");
  3174. DeletePVar(playerid, "JustCreatedHouse"), DeletePVar(playerid, "HousePreview"), DeletePVar(playerid, "HousePrevValue"), DeletePVar(playerid, "HousePrevName");
  3175. DeletePVar(playerid, "HousePrevInt"), DeletePVar(playerid, "HouseIntUpgradeMod"), DeletePVar(playerid, "IsHouseVisiting"), DeletePVar(playerid, "ChangeHouseInt");
  3176. DeletePVar(playerid, "HousePrevTime"), DeletePVar(playerid, "HousePrevTimer"), DeletePVar(playerid, "OldHouseInt"), DeletePVar(playerid, "ClickedHouse");
  3177. DeletePVar(playerid, "ClickedPlayer"), DeletePVar(playerid, "TimeSinceHouseBreakin");
  3178. DeletePVar(playerid, "IsRobbingHouse"), DeletePVar(playerid, "HouseRobberyTime"), DeletePVar(playerid, "HouseRobberyTimer"), DeletePVar(playerid, "TimeSinceHouseRobbery");
  3179. return 1;
  3180. }
  3181. stock fcreate(filename[])
  3182. {
  3183. if(fexist(filename)) return 0;
  3184. new File:file = fopen(filename, io_write);
  3185. fclose(file);
  3186. return 1;
  3187. }
  3188. stock RandomEx(min, max) return (random((max - min)) + min);
  3189. stock ExitHouse(playerid, houseid)
  3190. {
  3191. if(!IsPlayerInHouse(playerid, houseid)) return 1;
  3192. DeletePVar(playerid, "IsInHouse");
  3193. IsInHouse{playerid} = 0;
  3194. SetPlayerPosEx(playerid, hInfo[houseid][SpawnOutX], hInfo[houseid][SpawnOutY], hInfo[houseid][SpawnOutZ], hInfo[houseid][SpawnInterior], hInfo[houseid][SpawnWorld]);
  3195. SetPlayerFacingAngle(playerid, hInfo[houseid][SpawnOutAngle]);
  3196. SetPlayerInterior(playerid, hInfo[houseid][SpawnInterior]);
  3197. SetPlayerVirtualWorld(playerid, hInfo[houseid][SpawnWorld]);
  3198. if(GetPVarInt(playerid, "IsRobbingHouse") == 1)
  3199. {
  3200. ShowInfoBox(playerid, I_HROB_FAILED_HEXIT, hInfo[houseid][HouseName]);
  3201. EndHouseRobbery(playerid);
  3202. SetPVarInt(playerid, "IsRobbingHouse", 0);
  3203. SetPVarInt(playerid, "TimeSinceHouseRobbery", GetTickCount());
  3204. }
  3205. return 1;
  3206. }
  3207. stock udb_hash(buf[]) // By DracoBlue
  3208. {
  3209. new length = strlen(buf), s1 = 1, s2;
  3210. Loop(n, length, 0)
  3211. {
  3212. s1 = (s1 + buf[n]) % 65521, s2 = (s2 + s1) % 65521;
  3213. }
  3214. return (s2 << 16) + s1;
  3215. }
  3216. enum SAZONE_MAIN { SAZONE_NAME[28], Float:SAZONE_AREA[6] }; // By BetaMaster
  3217. static const gSAZones[][SAZONE_MAIN] =
  3218. {
  3219. {"24/7", {-34.23,-186.02,1003.54,-4.24,-169.91,1003.54}},
  3220. {"The Big Ear", {-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
  3221. {"Aldea Malvada", {-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
  3222. {"Angel Pine", {-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}},
  3223. {"Arco del Oeste", {-901.10,2221.80,0.00,-592.00,2571.90,200.00}},
  3224. {"Avispa Country Club", {-2646.40,-355.40,0.00,-2270.00,-222.50,200.00}},
  3225. {"Avispa Country Club", {-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00}},
  3226. {"Avispa Country Club", {-2361.50,-417.10,0.00,-2270.00,-355.40,200.00}},
  3227. {"Avispa Country Club", {-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10}},
  3228. {"Avispa Country Club", {-2470.00,-355.40,0.00,-2270.00,-318.40,46.10}},
  3229. {"Avispa Country Club", {-2550.00,-355.40,0.00,-2470.00,-318.40,39.70}},
  3230. {"Back o' Beyond", {-1166.90,-2641.10,0.00,-321.70,-1856.00,200.00}},
  3231. {"Bar", {487.65,-88.76,998.75,512.06,-67.74,999.25}},
  3232. {"Battery Point", {-2741.00,1268.40,-4.50,-2533.00,1490.40,200.00}},
  3233. {"Bayside", {-2741.00,2175.10,0.00,-2353.10,2722.70,200.00}},
  3234. {"Bayside Marina", {-2353.10,2275.70,0.00,-2153.10,2475.70,200.00}},
  3235. {"Beacon Hill", {-399.60,-1075.50,-1.40,-319.00,-977.50,198.50}},
  3236. {"Blackfield", {964.30,1203.20,-89.00,1197.30,1403.20,110.90}},
  3237. {"Blackfield", {964.30,1403.20,-89.00,1197.30,1726.20,110.90}},
  3238. {"Blackfield Chapel", {1375.60,596.30,-89.00,1558.00,823.20,110.90}},
  3239. {"Blackfield Chapel", {1325.60,596.30,-89.00,1375.60,795.00,110.90}},
  3240. {"Blackfield Intersection", {1197.30,1044.60,-89.00,1277.00,1163.30,110.90}},
  3241. {"Blackfield Intersection", {1166.50,795.00,-89.00,1375.60,1044.60,110.90}},
  3242. {"Blackfield Intersection", {1277.00,1044.60,-89.00,1315.30,1087.60,110.90}},
  3243. {"Blackfield Intersection", {1375.60,823.20,-89.00,1457.30,919.40,110.90}},
  3244. {"Blueberry", {104.50,-220.10,2.30,349.60,152.20,200.00}},
  3245. {"Blueberry", {19.60,-404.10,3.80,349.60,-220.10,200.00}},
  3246. {"Blueberry Acres", {-319.60,-220.10,0.00,104.50,293.30,200.00}},
  3247. {"Caligula's Casino", {2087.30,1543.20,-89.00,2437.30,1703.20,110.90}},
  3248. {"Caligula's Casino", {2137.40,1703.20,-89.00,2437.30,1783.20,110.90}},
  3249. {"Calton Heights", {-2274.10,744.10,-6.10,-1982.30,1358.90,200.00}},
  3250. {"Chinatown", {-2274.10,578.30,-7.60,-2078.60,744.10,200.00}},
  3251. {"City Hall", {-2867.80,277.40,-9.10,-2593.40,458.40,200.00}},
  3252. {"Come-A-Lot", {2087.30,943.20,-89.00,2623.10,1203.20,110.90}},
  3253. {"Commerce", {1323.90,-1842.20,-89.00,1701.90,-1722.20,110.90}},
  3254. {"Commerce", {1323.90,-1722.20,-89.00,1440.90,-1577.50,110.90}},
  3255. {"Commerce", {1370.80,-1577.50,-89.00,1463.90,-1384.90,110.90}},
  3256. {"Commerce", {1463.90,-1577.50,-89.00,1667.90,-1430.80,110.90}},
  3257. {"Commerce", {1583.50,-1722.20,-89.00,1758.90,-1577.50,110.90}},
  3258. {"Commerce", {1667.90,-1577.50,-89.00,1812.60,-1430.80,110.90}},
  3259. {"Conference Center", {1046.10,-1804.20,-89.00,1323.90,-1722.20,110.90}},
  3260. {"Conference Center", {1073.20,-1842.20,-89.00,1323.90,-1804.20,110.90}},
  3261. {"Cranberry Station", {-2007.80,56.30,0.00,-1922.00,224.70,100.00}},
  3262. {"Creek", {2749.90,1937.20,-89.00,2921.60,2669.70,110.90}},
  3263. {"Dillimore", {580.70,-674.80,-9.50,861.00,-404.70,200.00}},
  3264. {"Downtown San Fierro", {-2270.00,-324.10,-0.00,-1794.90,-222.50,200.00}},
  3265. {"Downtown San Fierro", {-2173.00,-222.50,-0.00,-1794.90,265.20,200.00}},
  3266. {"Downtown San Fierro", {-1982.30,744.10,-6.10,-1871.70,1274.20,200.00}},
  3267. {"Downtown San Fierro", {-1871.70,1176.40,-4.50,-1620.30,1274.20,200.00}},
  3268. {"Downtown San Fierro", {-1700.00,744.20,-6.10,-1580.00,1176.50,200.00}},
  3269. {"Downtown San Fierro", {-1580.00,744.20,-6.10,-1499.80,1025.90,200.00}},
  3270. {"Downtown San Fierro", {-2078.60,578.30,-7.60,-1499.80,744.20,200.00}},
  3271. {"Downtown San Fierro", {-1993.20,265.20,-9.10,-1794.90,578.30,200.00}},
  3272. {"Downtown Los Santos", {1463.90,-1430.80,-89.00,1724.70,-1290.80,110.90}},
  3273. {"Downtown Los Santos", {1724.70,-1430.80,-89.00,1812.60,-1250.90,110.90}},
  3274. {"Downtown Los Santos", {1463.90,-1290.80,-89.00,1724.70,-1150.80,110.90}},
  3275. {"Downtown Los Santos", {1370.80,-1384.90,-89.00,1463.90,-1170.80,110.90}},
  3276. {"Downtown Los Santos", {1724.70,-1250.90,-89.00,1812.60,-1150.80,110.90}},
  3277. {"Downtown Los Santos", {1370.80,-1170.80,-89.00,1463.90,-1130.80,110.90}},
  3278. {"Downtown Los Santos", {1378.30,-1130.80,-89.00,1463.90,-1026.30,110.90}},
  3279. {"Downtown Los Santos", {1391.00,-1026.30,-89.00,1463.90,-926.90,110.90}},
  3280. {"Downtown Los Santos", {1507.50,-1385.20,110.90,1582.50,-1325.30,335.90}},
  3281. {"East Beach", {2632.80,-1852.80,-89.00,2959.30,-1668.10,110.90}},
  3282. {"East Beach", {2632.80,-1668.10,-89.00,2747.70,-1393.40,110.90}},
  3283. {"East Beach", {2747.70,-1668.10,-89.00,2959.30,-1498.60,110.90}},
  3284. {"East Beach", {2747.70,-1498.60,-89.00,2959.30,-1120.00,110.90}},
  3285. {"East Los Santos", {2421.00,-1628.50,-89.00,2632.80,-1454.30,110.90}},
  3286. {"East Los Santos", {2222.50,-1628.50,-89.00,2421.00,-1494.00,110.90}},
  3287. {"East Los Santos", {2266.20,-1494.00,-89.00,2381.60,-1372.00,110.90}},
  3288. {"East Los Santos", {2381.60,-1494.00,-89.00,2421.00,-1454.30,110.90}},
  3289. {"East Los Santos", {2281.40,-1372.00,-89.00,2381.60,-1135.00,110.90}},
  3290. {"East Los Santos", {2381.60,-1454.30,-89.00,2462.10,-1135.00,110.90}},
  3291. {"East Los Santos", {2462.10,-1454.30,-89.00,2581.70,-1135.00,110.90}},
  3292. {"Easter Basin", {-1794.90,249.90,-9.10,-1242.90,578.30,200.00}},
  3293. {"Easter Basin", {-1794.90,-50.00,-0.00,-1499.80,249.90,200.00}},
  3294. {"Easter Bay Airport", {-1499.80,-50.00,-0.00,-1242.90,249.90,200.00}},
  3295. {"Easter Bay Airport", {-1794.90,-730.10,-3.00,-1213.90,-50.00,200.00}},
  3296. {"Easter Bay Airport", {-1213.90,-730.10,0.00,-1132.80,-50.00,200.00}},
  3297. {"Easter Bay Airport", {-1242.90,-50.00,0.00,-1213.90,578.30,200.00}},
  3298. {"Easter Bay Airport", {-1213.90,-50.00,-4.50,-947.90,578.30,200.00}},
  3299. {"Easter Bay Airport", {-1315.40,-405.30,15.40,-1264.40,-209.50,25.40}},
  3300. {"Easter Bay Airport", {-1354.30,-287.30,15.40,-1315.40,-209.50,25.40}},
  3301. {"Easter Bay Airport", {-1490.30,-209.50,15.40,-1264.40,-148.30,25.40}},
  3302. {"Easter Bay Chemicals", {-1132.80,-768.00,0.00,-956.40,-578.10,200.00}},
  3303. {"Easter Bay Chemicals", {-1132.80,-787.30,0.00,-956.40,-768.00,200.00}},
  3304. {"El Castillo del Diablo", {-464.50,2217.60,0.00,-208.50,2580.30,200.00}},
  3305. {"El Castillo del Diablo", {-208.50,2123.00,-7.60,114.00,2337.10,200.00}},
  3306. {"El Castillo del Diablo", {-208.50,2337.10,0.00,8.40,2487.10,200.00}},
  3307. {"El Corona", {1812.60,-2179.20,-89.00,1970.60,-1852.80,110.90}},
  3308. {"El Corona", {1692.60,-2179.20,-89.00,1812.60,-1842.20,110.90}},
  3309. {"El Quebrados", {-1645.20,2498.50,0.00,-1372.10,2777.80,200.00}},
  3310. {"Esplanade East", {-1620.30,1176.50,-4.50,-1580.00,1274.20,200.00}},
  3311. {"Esplanade East", {-1580.00,1025.90,-6.10,-1499.80,1274.20,200.00}},
  3312. {"Esplanade East", {-1499.80,578.30,-79.60,-1339.80,1274.20,20.30}},
  3313. {"Esplanade North", {-2533.00,1358.90,-4.50,-1996.60,1501.20,200.00}},
  3314. {"Esplanade North", {-1996.60,1358.90,-4.50,-1524.20,1592.50,200.00}},
  3315. {"Esplanade North", {-1982.30,1274.20,-4.50,-1524.20,1358.90,200.00}},
  3316. {"Fallen Tree", {-792.20,-698.50,-5.30,-452.40,-380.00,200.00}},
  3317. {"Fallow Bridge", {434.30,366.50,0.00,603.00,555.60,200.00}},
  3318. {"Fern Ridge", {508.10,-139.20,0.00,1306.60,119.50,200.00}},
  3319. {"Financial", {-1871.70,744.10,-6.10,-1701.30,1176.40,300.00}},
  3320. {"Fisher's Lagoon", {1916.90,-233.30,-100.00,2131.70,13.80,200.00}},
  3321. {"Flint Intersection", {-187.70,-1596.70,-89.00,17.00,-1276.60,110.90}},
  3322. {"Flint Range", {-594.10,-1648.50,0.00,-187.70,-1276.60,200.00}},
  3323. {"Fort Carson", {-376.20,826.30,-3.00,123.70,1220.40,200.00}},
  3324. {"Foster Valley", {-2270.00,-430.20,-0.00,-2178.60,-324.10,200.00}},
  3325. {"Foster Valley", {-2178.60,-599.80,-0.00,-1794.90,-324.10,200.00}},
  3326. {"Foster Valley", {-2178.60,-1115.50,0.00,-1794.90,-599.80,200.00}},
  3327. {"Foster Valley", {-2178.60,-1250.90,0.00,-1794.90,-1115.50,200.00}},
  3328. {"Frederick Bridge", {2759.20,296.50,0.00,2774.20,594.70,200.00}},
  3329. {"Gant Bridge", {-2741.40,1659.60,-6.10,-2616.40,2175.10,200.00}},
  3330. {"Gant Bridge", {-2741.00,1490.40,-6.10,-2616.40,1659.60,200.00}},
  3331. {"Ganton", {2222.50,-1852.80,-89.00,2632.80,-1722.30,110.90}},
  3332. {"Ganton", {2222.50,-1722.30,-89.00,2632.80,-1628.50,110.90}},
  3333. {"Garcia", {-2411.20,-222.50,-0.00,-2173.00,265.20,200.00}},
  3334. {"Garcia", {-2395.10,-222.50,-5.30,-2354.00,-204.70,200.00}},
  3335. {"Garver Bridge", {-1339.80,828.10,-89.00,-1213.90,1057.00,110.90}},
  3336. {"Garver Bridge", {-1213.90,950.00,-89.00,-1087.90,1178.90,110.90}},
  3337. {"Garver Bridge", {-1499.80,696.40,-179.60,-1339.80,925.30,20.30}},
  3338. {"Glen Park", {1812.60,-1449.60,-89.00,1996.90,-1350.70,110.90}},
  3339. {"Glen Park", {1812.60,-1100.80,-89.00,1994.30,-973.30,110.90}},
  3340. {"Glen Park", {1812.60,-1350.70,-89.00,2056.80,-1100.80,110.90}},
  3341. {"Green Palms", {176.50,1305.40,-3.00,338.60,1520.70,200.00}},
  3342. {"Greenglass College", {964.30,1044.60,-89.00,1197.30,1203.20,110.90}},
  3343. {"Greenglass College", {964.30,930.80,-89.00,1166.50,1044.60,110.90}},
  3344. {"Hampton Barns", {603.00,264.30,0.00,761.90,366.50,200.00}},
  3345. {"Hankypanky Point", {2576.90,62.10,0.00,2759.20,385.50,200.00}},
  3346. {"Harry Gold Parkway", {1777.30,863.20,-89.00,1817.30,2342.80,110.90}},
  3347. {"Hashbury", {-2593.40,-222.50,-0.00,-2411.20,54.70,200.00}},
  3348. {"Hilltop Farm", {967.30,-450.30,-3.00,1176.70,-217.90,200.00}},
  3349. {"Hunter Quarry", {337.20,710.80,-115.20,860.50,1031.70,203.70}},
  3350. {"Idlewood", {1812.60,-1852.80,-89.00,1971.60,-1742.30,110.90}},
  3351. {"Idlewood", {1812.60,-1742.30,-89.00,1951.60,-1602.30,110.90}},
  3352. {"Idlewood", {1951.60,-1742.30,-89.00,2124.60,-1602.30,110.90}},
  3353. {"Idlewood", {1812.60,-1602.30,-89.00,2124.60,-1449.60,110.90}},
  3354. {"Idlewood", {2124.60,-1742.30,-89.00,2222.50,-1494.00,110.90}},
  3355. {"Idlewood", {1971.60,-1852.80,-89.00,2222.50,-1742.30,110.90}},
  3356. {"Jefferson", {1996.90,-1449.60,-89.00,2056.80,-1350.70,110.90}},
  3357. {"Jefferson", {2124.60,-1494.00,-89.00,2266.20,-1449.60,110.90}},
  3358. {"Jefferson", {2056.80,-1372.00,-89.00,2281.40,-1210.70,110.90}},
  3359. {"Jefferson", {2056.80,-1210.70,-89.00,2185.30,-1126.30,110.90}},
  3360. {"Jefferson", {2185.30,-1210.70,-89.00,2281.40,-1154.50,110.90}},
  3361. {"Jefferson", {2056.80,-1449.60,-89.00,2266.20,-1372.00,110.90}},
  3362. {"Julius Thruway East", {2623.10,943.20,-89.00,2749.90,1055.90,110.90}},
  3363. {"Julius Thruway East", {2685.10,1055.90,-89.00,2749.90,2626.50,110.90}},
  3364. {"Julius Thruway East", {2536.40,2442.50,-89.00,2685.10,2542.50,110.90}},
  3365. {"Julius Thruway East", {2625.10,2202.70,-89.00,2685.10,2442.50,110.90}},
  3366. {"Julius Thruway North", {2498.20,2542.50,-89.00,2685.10,2626.50,110.90}},
  3367. {"Julius Thruway North", {2237.40,2542.50,-89.00,2498.20,2663.10,110.90}},
  3368. {"Julius Thruway North", {2121.40,2508.20,-89.00,2237.40,2663.10,110.90}},
  3369. {"Julius Thruway North", {1938.80,2508.20,-89.00,2121.40,2624.20,110.90}},
  3370. {"Julius Thruway North", {1534.50,2433.20,-89.00,1848.40,2583.20,110.90}},
  3371. {"Julius Thruway North", {1848.40,2478.40,-89.00,1938.80,2553.40,110.90}},
  3372. {"Julius Thruway North", {1704.50,2342.80,-89.00,1848.40,2433.20,110.90}},
  3373. {"Julius Thruway North", {1377.30,2433.20,-89.00,1534.50,2507.20,110.90}},
  3374. {"Julius Thruway South", {1457.30,823.20,-89.00,2377.30,863.20,110.90}},
  3375. {"Julius Thruway South", {2377.30,788.80,-89.00,2537.30,897.90,110.90}},
  3376. {"Julius Thruway West", {1197.30,1163.30,-89.00,1236.60,2243.20,110.90}},
  3377. {"Julius Thruway West", {1236.60,2142.80,-89.00,1297.40,2243.20,110.90}},
  3378. {"Juniper Hill", {-2533.00,578.30,-7.60,-2274.10,968.30,200.00}},
  3379. {"Juniper Hollow", {-2533.00,968.30,-6.10,-2274.10,1358.90,200.00}},
  3380. {"K.A.C.C. Military Fuels", {2498.20,2626.50,-89.00,2749.90,2861.50,110.90}},
  3381. {"Kincaid Bridge", {-1339.80,599.20,-89.00,-1213.90,828.10,110.90}},
  3382. {"Kincaid Bridge", {-1213.90,721.10,-89.00,-1087.90,950.00,110.90}},
  3383. {"Kincaid Bridge", {-1087.90,855.30,-89.00,-961.90,986.20,110.90}},
  3384. {"King's", {-2329.30,458.40,-7.60,-1993.20,578.30,200.00}},
  3385. {"King's", {-2411.20,265.20,-9.10,-1993.20,373.50,200.00}},
  3386. {"King's", {-2253.50,373.50,-9.10,-1993.20,458.40,200.00}},
  3387. {"LVA Freight Depot", {1457.30,863.20,-89.00,1777.40,1143.20,110.90}},
  3388. {"LVA Freight Depot", {1375.60,919.40,-89.00,1457.30,1203.20,110.90}},
  3389. {"LVA Freight Depot", {1277.00,1087.60,-89.00,1375.60,1203.20,110.90}},
  3390. {"LVA Freight Depot", {1315.30,1044.60,-89.00,1375.60,1087.60,110.90}},
  3391. {"LVA Freight Depot", {1236.60,1163.40,-89.00,1277.00,1203.20,110.90}},
  3392. {"Las Barrancas", {-926.10,1398.70,-3.00,-719.20,1634.60,200.00}},
  3393. {"Las Brujas", {-365.10,2123.00,-3.00,-208.50,2217.60,200.00}},
  3394. {"Las Colinas", {1994.30,-1100.80,-89.00,2056.80,-920.80,110.90}},
  3395. {"Las Colinas", {2056.80,-1126.30,-89.00,2126.80,-920.80,110.90}},
  3396. {"Las Colinas", {2185.30,-1154.50,-89.00,2281.40,-934.40,110.90}},
  3397. {"Las Colinas", {2126.80,-1126.30,-89.00,2185.30,-934.40,110.90}},
  3398. {"Las Colinas", {2747.70,-1120.00,-89.00,2959.30,-945.00,110.90}},
  3399. {"Las Colinas", {2632.70,-1135.00,-89.00,2747.70,-945.00,110.90}},
  3400. {"Las Colinas", {2281.40,-1135.00,-89.00,2632.70,-945.00,110.90}},
  3401. {"Las Payasadas", {-354.30,2580.30,2.00,-133.60,2816.80,200.00}},
  3402. {"Las Venturas Airport", {1236.60,1203.20,-89.00,1457.30,1883.10,110.90}},
  3403. {"Las Venturas Airport", {1457.30,1203.20,-89.00,1777.30,1883.10,110.90}},
  3404. {"Las Venturas Airport", {1457.30,1143.20,-89.00,1777.40,1203.20,110.90}},
  3405. {"Las Venturas Airport", {1515.80,1586.40,-12.50,1729.90,1714.50,87.50}},
  3406. {"Last Dime Motel", {1823.00,596.30,-89.00,1997.20,823.20,110.90}},
  3407. {"Leafy Hollow", {-1166.90,-1856.00,0.00,-815.60,-1602.00,200.00}},
  3408. {"Liberty City", {-1000.00,400.00,1300.00,-700.00,600.00,1400.00}},
  3409. {"Lil' Probe Inn", {-90.20,1286.80,-3.00,153.80,1554.10,200.00}},
  3410. {"Linden Side", {2749.90,943.20,-89.00,2923.30,1198.90,110.90}},
  3411. {"Linden Station", {2749.90,1198.90,-89.00,2923.30,1548.90,110.90}},
  3412. {"Linden Station", {2811.20,1229.50,-39.50,2861.20,1407.50,60.40}},
  3413. {"Little Mexico", {1701.90,-1842.20,-89.00,1812.60,-1722.20,110.90}},
  3414. {"Little Mexico", {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
  3415. {"Los Flores", {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
  3416. {"Los Flores", {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
  3417. {"Los Santos International", {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
  3418. {"Los Santos International", {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
  3419. {"Los Santos International", {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
  3420. {"Los Santos International", {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
  3421. {"Los Santos International", {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
  3422. {"Los Santos International", {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
  3423. {"Marina", {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
  3424. {"Marina", {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
  3425. {"Marina", {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
  3426. {"Market", {787.40,-1416.20,-89.00,1072.60,-1310.20,110.90}},
  3427. {"Market", {952.60,-1310.20,-89.00,1072.60,-1130.80,110.90}},
  3428. {"Market", {1072.60,-1416.20,-89.00,1370.80,-1130.80,110.90}},
  3429. {"Market", {926.90,-1577.50,-89.00,1370.80,-1416.20,110.90}},
  3430. {"Market Station", {787.40,-1410.90,-34.10,866.00,-1310.20,65.80}},
  3431. {"Martin Bridge", {-222.10,293.30,0.00,-122.10,476.40,200.00}},
  3432. {"Missionary Hill", {-2994.40,-811.20,0.00,-2178.60,-430.20,200.00}},
  3433. {"Montgomery", {1119.50,119.50,-3.00,1451.40,493.30,200.00}},
  3434. {"Montgomery", {1451.40,347.40,-6.10,1582.40,420.80,200.00}},
  3435. {"Montgomery Intersection", {1546.60,208.10,0.00,1745.80,347.40,200.00}},
  3436. {"Montgomery Intersection", {1582.40,347.40,0.00,1664.60,401.70,200.00}},
  3437. {"Mulholland", {1414.00,-768.00,-89.00,1667.60,-452.40,110.90}},
  3438. {"Mulholland", {1281.10,-452.40,-89.00,1641.10,-290.90,110.90}},
  3439. {"Mulholland", {1269.10,-768.00,-89.00,1414.00,-452.40,110.90}},
  3440. {"Mulholland", {1357.00,-926.90,-89.00,1463.90,-768.00,110.90}},
  3441. {"Mulholland", {1318.10,-910.10,-89.00,1357.00,-768.00,110.90}},
  3442. {"Mulholland", {1169.10,-910.10,-89.00,1318.10,-768.00,110.90}},
  3443. {"Mulholland", {768.60,-954.60,-89.00,952.60,-860.60,110.90}},
  3444. {"Mulholland", {687.80,-860.60,-89.00,911.80,-768.00,110.90}},
  3445. {"Mulholland", {737.50,-768.00,-89.00,1142.20,-674.80,110.90}},
  3446. {"Mulholland", {1096.40,-910.10,-89.00,1169.10,-768.00,110.90}},
  3447. {"Mulholland", {952.60,-937.10,-89.00,1096.40,-860.60,110.90}},
  3448. {"Mulholland", {911.80,-860.60,-89.00,1096.40,-768.00,110.90}},
  3449. {"Mulholland", {861.00,-674.80,-89.00,1156.50,-600.80,110.90}},
  3450. {"Mulholland Intersection", {1463.90,-1150.80,-89.00,1812.60,-768.00,110.90}},
  3451. {"North Rock", {2285.30,-768.00,0.00,2770.50,-269.70,200.00}},
  3452. {"Ocean Docks", {2373.70,-2697.00,-89.00,2809.20,-2330.40,110.90}},
  3453. {"Ocean Docks", {2201.80,-2418.30,-89.00,2324.00,-2095.00,110.90}},
  3454. {"Ocean Docks", {2324.00,-2302.30,-89.00,2703.50,-2145.10,110.90}},
  3455. {"Ocean Docks", {2089.00,-2394.30,-89.00,2201.80,-2235.80,110.90}},
  3456. {"Ocean Docks", {2201.80,-2730.80,-89.00,2324.00,-2418.30,110.90}},
  3457. {"Ocean Docks", {2703.50,-2302.30,-89.00,2959.30,-2126.90,110.90}},
  3458. {"Ocean Docks", {2324.00,-2145.10,-89.00,2703.50,-2059.20,110.90}},
  3459. {"Ocean Flats", {-2994.40,277.40,-9.10,-2867.80,458.40,200.00}},
  3460. {"Ocean Flats", {-2994.40,-222.50,-0.00,-2593.40,277.40,200.00}},
  3461. {"Ocean Flats", {-2994.40,-430.20,-0.00,-2831.80,-222.50,200.00}},
  3462. {"Octane Springs", {338.60,1228.50,0.00,664.30,1655.00,200.00}},
  3463. {"Old Venturas Strip", {2162.30,2012.10,-89.00,2685.10,2202.70,110.90}},
  3464. {"Palisades", {-2994.40,458.40,-6.10,-2741.00,1339.60,200.00}},
  3465. {"Palomino Creek", {2160.20,-149.00,0.00,2576.90,228.30,200.00}},
  3466. {"Paradiso", {-2741.00,793.40,-6.10,-2533.00,1268.40,200.00}},
  3467. {"Pershing Square", {1440.90,-1722.20,-89.00,1583.50,-1577.50,110.90}},
  3468. {"Pilgrim", {2437.30,1383.20,-89.00,2624.40,1783.20,110.90}},
  3469. {"Pilgrim", {2624.40,1383.20,-89.00,2685.10,1783.20,110.90}},
  3470. {"Pilson Intersection", {1098.30,2243.20,-89.00,1377.30,2507.20,110.90}},
  3471. {"Pirates in Men's Pants", {1817.30,1469.20,-89.00,2027.40,1703.20,110.90}},
  3472. {"Playa del Seville", {2703.50,-2126.90,-89.00,2959.30,-1852.80,110.90}},
  3473. {"Prickle Pine", {1534.50,2583.20,-89.00,1848.40,2863.20,110.90}},
  3474. {"Prickle Pine", {1117.40,2507.20,-89.00,1534.50,2723.20,110.90}},
  3475. {"Prickle Pine", {1848.40,2553.40,-89.00,1938.80,2863.20,110.90}},
  3476. {"Prickle Pine", {1938.80,2624.20,-89.00,2121.40,2861.50,110.90}},
  3477. {"Queens", {-2533.00,458.40,0.00,-2329.30,578.30,200.00}},
  3478. {"Queens", {-2593.40,54.70,0.00,-2411.20,458.40,200.00}},
  3479. {"Queens", {-2411.20,373.50,0.00,-2253.50,458.40,200.00}},
  3480. {"Randolph Industrial Estate", {1558.00,596.30,-89.00,1823.00,823.20,110.90}},
  3481. {"Redsands East", {1817.30,2011.80,-89.00,2106.70,2202.70,110.90}},
  3482. {"Redsands East", {1817.30,2202.70,-89.00,2011.90,2342.80,110.90}},
  3483. {"Redsands East", {1848.40,2342.80,-89.00,2011.90,2478.40,110.90}},
  3484. {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
  3485. {"Redsands West", {1297.40,2142.80,-89.00,1777.30,2243.20,110.90}},
  3486. {"Redsands West", {1377.30,2243.20,-89.00,1704.50,2433.20,110.90}},
  3487. {"Redsands West", {1704.50,2243.20,-89.00,1777.30,2342.80,110.90}},
  3488. {"Regular Tom", {-405.70,1712.80,-3.00,-276.70,1892.70,200.00}},
  3489. {"Restraunt", {-229.07,1393.80,28.35,-222.40,1412.19,27.77}},
  3490. {"Restraunt", {-221.54,1401.45,27.77,-217.49,1407.54,28.41}},
  3491. {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
  3492. {"Richman", {647.50,-954.60,-89.00,768.60,-860.60,110.90}},
  3493. {"Richman", {225.10,-1369.60,-89.00,334.50,-1292.00,110.90}},
  3494. {"Richman", {225.10,-1292.00,-89.00,466.20,-1235.00,110.90}},
  3495. {"Richman", {72.60,-1404.90,-89.00,225.10,-1235.00,110.90}},
  3496. {"Richman", {72.60,-1235.00,-89.00,321.30,-1008.10,110.90}},
  3497. {"Richman", {321.30,-1235.00,-89.00,647.50,-1044.00,110.90}},
  3498. {"Richman", {321.30,-1044.00,-89.00,647.50,-860.60,110.90}},
  3499. {"Richman", {321.30,-860.60,-89.00,687.80,-768.00,110.90}},
  3500. {"Richman", {321.30,-768.00,-89.00,700.70,-674.80,110.90}},
  3501. {"Robada Intersection", {-1119.00,1178.90,-89.00,-862.00,1351.40,110.90}},
  3502. {"Roca Escalante", {2237.40,2202.70,-89.00,2536.40,2542.50,110.90}},
  3503. {"Roca Escalante", {2536.40,2202.70,-89.00,2625.10,2442.50,110.90}},
  3504. {"Rockshore East", {2537.30,676.50,-89.00,2902.30,943.20,110.90}},
  3505. {"Rockshore West", {1997.20,596.30,-89.00,2377.30,823.20,110.90}},
  3506. {"Rockshore West", {2377.30,596.30,-89.00,2537.30,788.80,110.90}},
  3507. {"Rodeo", {72.60,-1684.60,-89.00,225.10,-1544.10,110.90}},
  3508. {"Rodeo", {72.60,-1544.10,-89.00,225.10,-1404.90,110.90}},
  3509. {"Rodeo", {225.10,-1684.60,-89.00,312.80,-1501.90,110.90}},
  3510. {"Rodeo", {225.10,-1501.90,-89.00,334.50,-1369.60,110.90}},
  3511. {"Rodeo", {334.50,-1501.90,-89.00,422.60,-1406.00,110.90}},
  3512. {"Rodeo", {312.80,-1684.60,-89.00,422.60,-1501.90,110.90}},
  3513. {"Rodeo", {422.60,-1684.60,-89.00,558.00,-1570.20,110.90}},
  3514. {"Rodeo", {558.00,-1684.60,-89.00,647.50,-1384.90,110.90}},
  3515. {"Rodeo", {466.20,-1570.20,-89.00,558.00,-1385.00,110.90}},
  3516. {"Rodeo", {422.60,-1570.20,-89.00,466.20,-1406.00,110.90}},
  3517. {"Rodeo", {466.20,-1385.00,-89.00,647.50,-1235.00,110.90}},
  3518. {"Rodeo", {334.50,-1406.00,-89.00,466.20,-1292.00,110.90}},
  3519. {"Royal Casino", {2087.30,1383.20,-89.00,2437.30,1543.20,110.90}},
  3520. {"San Andreas Sound", {2450.30,385.50,-100.00,2759.20,562.30,200.00}},
  3521. {"Santa Flora", {-2741.00,458.40,-7.60,-2533.00,793.40,200.00}},
  3522. {"Santa Maria Beach", {342.60,-2173.20,-89.00,647.70,-1684.60,110.90}},
  3523. {"Santa Maria Beach", {72.60,-2173.20,-89.00,342.60,-1684.60,110.90}},
  3524. {"Shady Cabin", {-1632.80,-2263.40,-3.00,-1601.30,-2231.70,200.00}},
  3525. {"Shady Creeks", {-1820.60,-2643.60,-8.00,-1226.70,-1771.60,200.00}},
  3526. {"Shady Creeks", {-2030.10,-2174.80,-6.10,-1820.60,-1771.60,200.00}},
  3527. {"Sobell Rail Yards", {2749.90,1548.90,-89.00,2923.30,1937.20,110.90}},
  3528. {"Spinybed", {2121.40,2663.10,-89.00,2498.20,2861.50,110.90}},
  3529. {"Starfish Casino", {2437.30,1783.20,-89.00,2685.10,2012.10,110.90}},
  3530. {"Starfish Casino", {2437.30,1858.10,-39.00,2495.00,1970.80,60.90}},
  3531. {"Starfish Casino", {2162.30,1883.20,-89.00,2437.30,2012.10,110.90}},
  3532. {"Temple", {1252.30,-1130.80,-89.00,1378.30,-1026.30,110.90}},
  3533. {"Temple", {1252.30,-1026.30,-89.00,1391.00,-926.90,110.90}},
  3534. {"Temple", {1252.30,-926.90,-89.00,1357.00,-910.10,110.90}},
  3535. {"Temple", {952.60,-1130.80,-89.00,1096.40,-937.10,110.90}},
  3536. {"Temple", {1096.40,-1130.80,-89.00,1252.30,-1026.30,110.90}},
  3537. {"Temple", {1096.40,-1026.30,-89.00,1252.30,-910.10,110.90}},
  3538. {"The Camel's Toe", {2087.30,1203.20,-89.00,2640.40,1383.20,110.90}},
  3539. {"The Clown's Pocket", {2162.30,1783.20,-89.00,2437.30,1883.20,110.90}},
  3540. {"The Emerald Isle", {2011.90,2202.70,-89.00,2237.40,2508.20,110.90}},
  3541. {"The Farm", {-1209.60,-1317.10,114.90,-908.10,-787.30,251.90}},
  3542. {"The Four Dragons Casino", {1817.30,863.20,-89.00,2027.30,1083.20,110.90}},
  3543. {"The High Roller", {1817.30,1283.20,-89.00,2027.30,1469.20,110.90}},
  3544. {"The Mako Span", {1664.60,401.70,0.00,1785.10,567.20,200.00}},
  3545. {"The Panopticon", {-947.90,-304.30,-1.10,-319.60,327.00,200.00}},
  3546. {"The Pink Swan", {1817.30,1083.20,-89.00,2027.30,1283.20,110.90}},
  3547. {"The Sherman Dam", {-968.70,1929.40,-3.00,-481.10,2155.20,200.00}},
  3548. {"The Strip", {2027.40,863.20,-89.00,2087.30,1703.20,110.90}},
  3549. {"The Strip", {2106.70,1863.20,-89.00,2162.30,2202.70,110.90}},
  3550. {"The Strip", {2027.40,1783.20,-89.00,2162.30,1863.20,110.90}},
  3551. {"The Strip", {2027.40,1703.20,-89.00,2137.40,1783.20,110.90}},
  3552. {"The Visage", {1817.30,1863.20,-89.00,2106.70,2011.80,110.90}},
  3553. {"The Visage", {1817.30,1703.20,-89.00,2027.40,1863.20,110.90}},
  3554. {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},
  3555. {"Valle Ocultado", {-936.60,2611.40,2.00,-715.90,2847.90,200.00}},
  3556. {"Verdant Bluffs", {930.20,-2488.40,-89.00,1249.60,-2006.70,110.90}},
  3557. {"Verdant Bluffs", {1073.20,-2006.70,-89.00,1249.60,-1842.20,110.90}},
  3558. {"Verdant Bluffs", {1249.60,-2179.20,-89.00,1692.60,-1842.20,110.90}},
  3559. {"Verdant Meadows", {37.00,2337.10,-3.00,435.90,2677.90,200.00}},
  3560. {"Verona Beach", {647.70,-2173.20,-89.00,930.20,-1804.20,110.90}},
  3561. {"Verona Beach", {930.20,-2006.70,-89.00,1073.20,-1804.20,110.90}},
  3562. {"Verona Beach", {851.40,-1804.20,-89.00,1046.10,-1577.50,110.90}},
  3563. {"Verona Beach", {1161.50,-1722.20,-89.00,1323.90,-1577.50,110.90}},
  3564. {"Verona Beach", {1046.10,-1722.20,-89.00,1161.50,-1577.50,110.90}},
  3565. {"Vinewood", {787.40,-1310.20,-89.00,952.60,-1130.80,110.90}},
  3566. {"Vinewood", {787.40,-1130.80,-89.00,952.60,-954.60,110.90}},
  3567. {"Vinewood", {647.50,-1227.20,-89.00,787.40,-1118.20,110.90}},
  3568. {"Vinewood", {647.70,-1416.20,-89.00,787.40,-1227.20,110.90}},
  3569. {"Whitewood Estates", {883.30,1726.20,-89.00,1098.30,2507.20,110.90}},
  3570. {"Whitewood Estates", {1098.30,1726.20,-89.00,1197.30,2243.20,110.90}},
  3571. {"Willowfield", {1970.60,-2179.20,-89.00,2089.00,-1852.80,110.90}},
  3572. {"Willowfield", {2089.00,-2235.80,-89.00,2201.80,-1989.90,110.90}},
  3573. {"Willowfield", {2089.00,-1989.90,-89.00,2324.00,-1852.80,110.90}},
  3574. {"Willowfield", {2201.80,-2095.00,-89.00,2324.00,-1989.90,110.90}},
  3575. {"Willowfield", {2541.70,-1941.40,-89.00,2703.50,-1852.80,110.90}},
  3576. {"Willowfield", {2324.00,-2059.20,-89.00,2541.70,-1852.80,110.90}},
  3577. {"Willowfield", {2541.70,-2059.20,-89.00,2703.50,-1941.40,110.90}},
  3578. {"Yellow Bell Station", {1377.40,2600.40,-21.90,1492.40,2687.30,78.00}},
  3579. // Main Zones
  3580. {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
  3581. {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
  3582. {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
  3583. {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
  3584. {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
  3585. {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
  3586. {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
  3587. {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
  3588. {"San Andreas", {4601.083, -2989.536, -242.90, 2989.536, -3666.853, 1500.00}},
  3589. {"Mount Chilliad", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
  3590. };
  3591. stock GetHouseLocation(houseid) // By [03]Garsino
  3592. {
  3593. new zone[MAX_ZONE_NAME];
  3594. format(zone, MAX_ZONE_NAME, "Unknown");
  3595. new size = sizeof(gSAZones);
  3596. Loop(i, size, 0)
  3597. {
  3598. if(hInfo[houseid][CPOutX] >= gSAZones[i][SAZONE_AREA][0] && hInfo[houseid][CPOutX] <= gSAZones[i][SAZONE_AREA][3] && hInfo[houseid][CPOutY] >= gSAZones[i][SAZONE_AREA][1] && hInfo[houseid][CPOutY] <= gSAZones[i][SAZONE_AREA][4])
  3599. {
  3600. format(zone, MAX_ZONE_NAME, "%s", gSAZones[i][SAZONE_NAME]);
  3601. return zone;
  3602. }
  3603. }
  3604. return zone;
  3605. }
  3606. stock HouseFile(houseid)
  3607. {
  3608. new filename[HOUSEFILE_LENGTH];
  3609. format(filename, sizeof(filename), FILEPATH, houseid);
  3610. return filename;
  3611. }
  3612. stock EndHouseRobbery(playerid)
  3613. {
  3614. new timer_state = GetPVarInt(playerid, "HouseRobberyTimer");
  3615. if(timer_state != -1)
  3616. {
  3617. KillTimer(timer_state);
  3618. SetPVarInt(playerid, "HouseRobberyTimer", -1);
  3619. }
  3620. return 1;
  3621. }
  3622. stock SecurityDog_Bite(playerid, houseid, type, failed = 0)
  3623. {
  3624. if(hInfo[houseid][HouseDog] == 0) return 1;
  3625. new Float:health;
  3626. GetPlayerHealth(playerid, health);
  3627. ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  3628. if((health - (SECURITYDOG_HEALTHLOSS * SECURITYDOG_BITS)) <= 0.00)
  3629. {
  3630. SetPlayerHealth(playerid, 0.00);
  3631. switch(type)
  3632. {
  3633. case 0: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HBREAKIN_FAILED1);
  3634. case 1: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HROB_FAILED1);
  3635. }
  3636. }
  3637. else
  3638. {
  3639. SetPlayerHealth(playerid, (health - (SECURITYDOG_HEALTHLOSS * SECURITYDOG_BITS)));
  3640. if(failed == 1)
  3641. {
  3642. switch(type)
  3643. {
  3644. case 0: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HBREAKIN_FAILED2);
  3645. case 1: ShowInfoBoxEx(playerid, COLOUR_SYSTEM, HROB_FAILED2);
  3646. }
  3647. }
  3648. }
  3649. SetTimerEx("SecurityDog_ClearAnimations", 4000, false, "i", playerid);
  3650. return 1;
  3651. }
  3652. // © [03]Garsino - Keep The Credits!
Advertisement
Add Comment
Please, Sign In to add comment