Guest User

Untitled

a guest
Aug 24th, 2015
1,283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 32.08 KB | None | 0 0
  1. /*
  2.  
  3.     Dynamic House System by Twine. aka Pascal.
  4.  
  5. */
  6.  
  7. /* =====> [ Includes ] <=====*/
  8. #include <a_samp>
  9. #include <zcmd>
  10. #include <sscanf2>
  11. #include <streamer>
  12. #include <a_mysql>
  13.  
  14.  
  15. /* =====> [ Colors ] <=====*/
  16. #define COLOR_GREY 0xB4B4B4FF
  17. #define COLOR_RED 0xFF6347AA
  18. #define COLOR_DARKRED 0xB50000FF
  19. #define COLOR_BLUE 0x4B89C1FF
  20. #define COLOR_DARKBLUE 0x1E00FFFF
  21. #define COLOR_GREEN 0x67DE57FF
  22. #define COLOR_DARKGREEN 0x67A657FF
  23. #define COLOR_YELLOW 0xEBFF00FF
  24. #define COLOR_ORANGE 0xFF8022FF
  25. #define COLOR_BROWN 0xA44B13FF
  26.  
  27.  
  28. /* =====> [ Define's ] <=====*/
  29. #define MAX_HOUSE 100
  30.  
  31.  
  32. /* =====> [ Enum's ] <=====*/
  33. enum houseSystem {
  34.     h_owner[MAX_PLAYER_NAME],
  35.     h_interior,
  36.     h_buyscore,
  37.     h_buyprice,
  38.     h_pickup,
  39.     h_lock,
  40.     h_checkout,
  41.     Text3D:h_textlabel,
  42.     Float:h_x,
  43.     Float:h_y,
  44.     Float:h_z,
  45.     Float:i_x,
  46.     Float:i_y,
  47.     Float:i_z,
  48.     db_id
  49. }
  50.  
  51.  
  52. /* =====> [ Enum - Variablen ] <=====*/
  53. new houseInfo[MAX_HOUSE][houseSystem];
  54.  
  55.  
  56. /* =====> [ Variablen ] <=====*/
  57. new handle;
  58.  
  59.  
  60. /* =====> [ MySQL ] <=====*/
  61. #define SQL_HOST "127.0.0.1"
  62. #define SQL_USER "root"
  63. #define SQL_PASS ""
  64. #define SQL_DB "housesystem"
  65.  
  66.  
  67. /* =====> [ Dialoge ] <=====*/
  68. enum {
  69.     DIALOG_HOUSESCORE = 500,
  70.     DIALOG_HOUSEPRICE,
  71.     DIALOG_HOUSEINTX,
  72.     DIALOG_HOUSEINTY,
  73.     DIALOG_HOUSEINTZ,
  74.     DIALOG_HOUSEINTERIOR,
  75.     DIALOG_HOUSECONFIRM,
  76.     DIALOG_CHECKOUT,
  77.     DIALOG_ASETTINGS,
  78.     DIALOG_AHOUSEINTX,
  79.     DIALOG_AHOUSEINTY,
  80.     DIALOG_AHOUSEINTZ,
  81.     DIALOG_AHOUSEINTERIOR
  82. }
  83.  
  84.  
  85. /* =====> [ Forwards ] <=====*/
  86. forward LoadHouse();
  87. forward CreateHouse(id);
  88.  
  89.  
  90.  
  91. /*
  92.     ############################################################################################################################
  93.     ############################################################################################################################
  94.     ############################################################################################################################
  95.     ############################################################################################################################
  96.     ############################################################################################################################
  97.     ############################################################################################################################
  98.     ############################################################################################################################
  99. */
  100.  
  101. public OnFilterScriptInit()
  102. {
  103.     print("ยด\n######################################################");
  104.     print("##### Dynamic House System by Twine. aka Pascal. #####");
  105.     print("######################################################\n");
  106.  
  107.     DisableInteriorEnterExits();
  108.  
  109.     // MySQL
  110.     handle = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
  111.  
  112.     // Load House
  113.     new query[128];
  114.     format(query, sizeof(query), "SELECT * FROM `houses`");
  115.     mysql_function_query(handle, query, true, "LoadHouse", "");
  116.     return 1;
  117. }
  118.  
  119. public OnFilterScriptExit()
  120. {
  121.     mysql_close(handle);
  122.  
  123.     for (new i = 0; i < MAX_HOUSE; i++)
  124.     {
  125.         if (!houseInfo[i][db_id]) {
  126.             continue;
  127.         }
  128.  
  129.         SaveHouse(i);
  130.     }
  131.     return 1;
  132. }
  133.  
  134. public OnPlayerRequestClass(playerid, classid)
  135. {
  136.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  137.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  138.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  139.     return 1;
  140. }
  141.  
  142. public OnPlayerConnect(playerid)
  143. {
  144.     return 1;
  145. }
  146.  
  147. public OnPlayerDisconnect(playerid, reason)
  148. {
  149.     return 1;
  150. }
  151.  
  152. public OnPlayerSpawn(playerid)
  153. {
  154.     return 1;
  155. }
  156.  
  157. public OnPlayerDeath(playerid, killerid, reason)
  158. {
  159.     return 1;
  160. }
  161.  
  162. /* =====> [ Publics & Functions ] <===== */
  163.  
  164. public LoadHouse()
  165. {
  166.     new num_rows, num_fields, tmp_name[MAX_PLAYER_NAME];
  167.     new id = GetFreeHouseID();
  168.  
  169.     cache_get_data(num_rows, num_fields, handle);
  170.  
  171.     for (new i = 0; i < num_rows; i++)
  172.     {
  173.         cache_get_field_content(i, "owner", tmp_name, handle);
  174.         strmid(houseInfo[id][h_owner], tmp_name, 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  175.  
  176.         houseInfo[id][h_interior] = cache_get_field_content_int(i, "interior", handle);
  177.         houseInfo[id][h_buyscore] = cache_get_field_content_int(i, "buyscore", handle);
  178.         houseInfo[id][h_buyprice] = cache_get_field_content_int(i, "buyprice", handle);
  179.         houseInfo[id][h_lock]     = cache_get_field_content_int(i, "h_lock", handle);
  180.         houseInfo[id][h_checkout] = cache_get_field_content_int(i, "checkout", handle);
  181.         houseInfo[id][h_x]        = cache_get_field_content_float(i, "h_x", handle);
  182.         houseInfo[id][h_y]        = cache_get_field_content_float(i, "h_y", handle);
  183.         houseInfo[id][h_z]        = cache_get_field_content_float(i, "h_z", handle);
  184.         houseInfo[id][i_x]        = cache_get_field_content_float(i, "i_x", handle);
  185.         houseInfo[id][i_y]        = cache_get_field_content_float(i, "i_y", handle);
  186.         houseInfo[id][i_z]        = cache_get_field_content_float(i, "i_z", handle);
  187.         houseInfo[id][db_id]      = cache_get_field_content_int(i, "id", handle);
  188.  
  189.         // Create Textlabel and Pickups with a new function
  190.         UpdateHouse(id);
  191.  
  192.     }
  193.     return 1;
  194. }
  195.  
  196. public CreateHouse(id)
  197. {
  198.     houseInfo[id][db_id] = cache_insert_id(handle);
  199.     return 1;
  200. }
  201.  
  202. // Functions
  203.  
  204. stock PlayerName(playerid)
  205. {
  206.     new name[MAX_PLAYER_NAME];
  207.  
  208.     GetPlayerName(playerid, name, sizeof(name));
  209.     return name;
  210. }
  211.  
  212. stock GetFreeHouseID()
  213. {
  214.     for (new i = 0; i < sizeof(houseInfo); i++)
  215.     {
  216.         if (houseInfo[i][db_id] == 0) {
  217.             return i;
  218.         }
  219.     }
  220.     return 0;
  221. }
  222.  
  223. stock UpdateHouse(id)
  224. {
  225.     new string[512];
  226.  
  227.     if (houseInfo[id][h_pickup] != -1) {
  228.         DestroyDynamicPickup(houseInfo[id][h_pickup]);
  229.     }
  230.  
  231.     if (houseInfo[id][h_textlabel] != Text3D:-1) {
  232.         DestroyDynamic3DTextLabel(houseInfo[id][h_textlabel]);
  233.     }
  234.  
  235.     if (strlen(houseInfo[id][h_owner]))
  236.     {
  237.         format(string, sizeof(string), "\
  238.         {FF8567}HouseID: {FFFFFF}%i\n\
  239.         {FF8567}Owner: {FFFFFF}%s\n\n\
  240.         {FFFFFF}You can with {FF8567}\"/enter\" {FFFFFF}in this house",
  241.         houseInfo[id][db_id],
  242.         houseInfo[id][h_owner]);
  243.  
  244.         houseInfo[id][h_textlabel] = CreateDynamic3DTextLabel(string, -1, houseInfo[id][h_x], houseInfo[id][h_y], houseInfo[id][h_z], 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 250.0);
  245.         houseInfo[id][h_pickup] = CreateDynamicPickup(1272, 1, houseInfo[id][h_x], houseInfo[id][h_y], houseInfo[id][h_z], -1, -1, -1, 100.0);
  246.     }
  247.     else if (!strlen(houseInfo[id][h_owner]))
  248.     {
  249.         format(string, sizeof(string), "\
  250.         {FF8567}HouseID: {FFFFFF}%i\n\
  251.         {FF8567}Owner: {FFFFFF}- None -\n\
  252.         {FF8567}Score: {FFFFFF}%i\n\
  253.         {FF8567}Price: {FFFFFF}$%i\n\n\
  254.         {FFFFFF}You can buy this house with {FF8567}/buyhouse",
  255.         houseInfo[id][db_id],
  256.         houseInfo[id][h_buyscore],
  257.         houseInfo[id][h_buyprice]);
  258.  
  259.         houseInfo[id][h_textlabel] = CreateDynamic3DTextLabel(string, -1, houseInfo[id][h_x], houseInfo[id][h_y], houseInfo[id][h_z], 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 250.0);
  260.         houseInfo[id][h_pickup] = CreateDynamicPickup(1273, 1, houseInfo[id][h_x], houseInfo[id][h_y], houseInfo[id][h_z], -1, -1, -1, 100.0);
  261.     }
  262.     return 1;
  263. }
  264.  
  265. stock IsPlayerHouseOwner(playerid)
  266. {
  267.     for (new i = 0; i < MAX_HOUSE; i++)
  268.     {
  269.         if (!houseInfo[i][db_id]) continue;
  270.         if (!strlen(houseInfo[i][h_owner])) continue;
  271.  
  272.         if (!strcmp(PlayerName(playerid), houseInfo[i][h_owner], true)) {
  273.             return true;
  274.         }
  275.     }
  276.     return 0;
  277. }
  278.  
  279. stock SaveHouse(id)
  280. {
  281.     new query[364];
  282.  
  283.     format(query, sizeof(query), "UPDATE `houses` SET owner = '%s', interior = '%i', buyscore = '%i', buyprice = '%i', h_lock = '%i',\
  284.     checkout = '%i', i_x = '%f', i_y = '%f', i_z = '%f' WHERE id = '%i'",
  285.     houseInfo[id][h_owner],
  286.     houseInfo[id][h_interior],
  287.     houseInfo[id][h_buyscore],
  288.     houseInfo[id][h_buyprice],
  289.     houseInfo[id][h_lock],
  290.     houseInfo[id][h_checkout],
  291.     houseInfo[id][i_x],
  292.     houseInfo[id][i_y],
  293.     houseInfo[id][i_z],
  294.     houseInfo[id][db_id]);
  295.  
  296.     mysql_function_query(handle, query, false, "", "");
  297.     return 1;
  298. }
  299.  
  300. /*
  301.     ####################################################################################################
  302.     ####################################################################################################
  303.     ####################################################################################################
  304.     ####################################################################################################
  305.     ####################################################################################################
  306. */
  307.  
  308. public OnVehicleSpawn(vehicleid)
  309. {
  310.     return 1;
  311. }
  312.  
  313. public OnVehicleDeath(vehicleid, killerid)
  314. {
  315.     return 1;
  316. }
  317.  
  318. public OnPlayerText(playerid, text[])
  319. {
  320.     return 1;
  321. }
  322.  
  323. /* =====> [ CMD - Commands ] <===== */
  324. CMD:createhouse(playerid, params[])
  325. {
  326.     #pragma unused params
  327.  
  328.     new string[164], index = 0;
  329.  
  330.     if (!IsPlayerAdmin(playerid)) {
  331.         return SendClientMessage(playerid, COLOR_GREY, "You are no admin!");
  332.     }
  333.  
  334.     for (new i = 0; i < MAX_HOUSE; i++)
  335.     {
  336.         if (!houseInfo[i][db_id]) {
  337.             continue;
  338.         }
  339.  
  340.         index++;
  341.     }
  342.  
  343.     if (index >= MAX_HOUSE) {
  344.         format(string, sizeof(string), "There are already %i houses", MAX_HOUSE);
  345.         return SendClientMessage(playerid, COLOR_RED, string);
  346.     }
  347.  
  348.     format(string, sizeof(string), "At what level should you buy this House?\nPlease select a level:");
  349.     ShowPlayerDialog(playerid, DIALOG_HOUSESCORE, DIALOG_STYLE_INPUT, "Create house - score", string, "Next", "Cancel");
  350.     return 1;
  351. }
  352.  
  353. CMD:deletehouse(playerid, params[])
  354. {
  355.     new string[164], query[128], hID;
  356.  
  357.     if (!IsPlayerAdmin(playerid)) {
  358.         return SendClientMessage(playerid, COLOR_GREY, "You are no admin!");
  359.     }
  360.  
  361.     if (sscanf(params, "i", hID)) {
  362.         return SendClientMessage(playerid, COLOR_GREY, "[Command]: /deletehouse [houseID]");
  363.     }
  364.  
  365.     for (new i = 0; i < MAX_HOUSE; i++)
  366.     {
  367.         if (!houseInfo[i][db_id] || houseInfo[i][db_id] != hID) {
  368.             continue;
  369.         }
  370.  
  371.         strmid(houseInfo[i][h_owner], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  372.         houseInfo[i][h_interior] = 0;
  373.         houseInfo[i][h_buyscore] = 0;
  374.         houseInfo[i][h_buyprice] = 0;
  375.         houseInfo[i][h_pickup] = -1;
  376.         houseInfo[i][h_lock] = 0;
  377.         houseInfo[i][h_checkout] = 0;
  378.         houseInfo[i][h_textlabel] = Text3D:-1;
  379.         houseInfo[i][h_x] = 0.0;
  380.         houseInfo[i][h_y] = 0.0;
  381.         houseInfo[i][h_z] = 0.0;
  382.         houseInfo[i][i_x] = 0.0;
  383.         houseInfo[i][i_y] = 0.0;
  384.         houseInfo[i][i_z] = 0.0;
  385.  
  386.         if (houseInfo[i][h_pickup]) {
  387.             DestroyDynamicPickup(houseInfo[i][h_pickup]);
  388.         }
  389.  
  390.         if (houseInfo[i][h_textlabel]) {
  391.             DestroyDynamic3DTextLabel(houseInfo[i][h_textlabel]);
  392.         }
  393.     }
  394.  
  395.     format(string, sizeof(string), "You have deleted the House with ID %i", hID);
  396.     SendClientMessage(playerid, COLOR_GREEN, string);
  397.  
  398.     format(query, sizeof(query), "DELETE FROM `houses` WHERE id = '%i'", hID);
  399.     mysql_function_query(handle, query, false, "", "");
  400.     return 1;
  401. }
  402.  
  403. CMD:buyhouse(playerid, params[])
  404. {
  405.     new string[128];
  406.  
  407.     for (new i = 0; i < MAX_HOUSE; i++)
  408.     {
  409.         if (!houseInfo[i][db_id]) {
  410.             continue;
  411.         }
  412.  
  413.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  414.         {
  415.             if (IsPlayerHouseOwner(playerid) == 1) {
  416.                 return SendClientMessage(playerid, COLOR_RED, "You already have a house!");
  417.             }
  418.  
  419.             if (strlen(houseInfo[i][h_owner])) {
  420.                 return SendClientMessage(playerid, COLOR_RED, "This house is sold!");
  421.             }
  422.  
  423.             if (GetPlayerScore(playerid) < houseInfo[i][h_buyscore]) {
  424.                 return SendClientMessage(playerid, COLOR_GREY, "You have not the necessary score for the House!");
  425.             }
  426.  
  427.             if (GetPlayerMoney(playerid) < houseInfo[i][h_buyprice]) {
  428.                 return SendClientMessage(playerid, COLOR_GREY, "You have not enough money!");
  429.             }
  430.  
  431.             strmid(houseInfo[i][h_owner], PlayerName(playerid), 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  432.             houseInfo[i][h_lock] = 1;
  433.             houseInfo[i][h_checkout] = 0;
  434.  
  435.             format(string, sizeof(string), "You have successfully purchased the House for $%i", houseInfo[i][h_buyprice]);
  436.             SendClientMessage(playerid, COLOR_BLUE, string);
  437.  
  438.             UpdateHouse(i);
  439.             SaveHouse(i);
  440.             return 1;
  441.         }
  442.     }
  443.     return 1;
  444. }
  445.  
  446. CMD:checkout(playerid, params[])
  447. {
  448.     new string[128];
  449.  
  450.     if (IsPlayerHouseOwner(playerid) == 0) {
  451.         return SendClientMessage(playerid, COLOR_RED, "You have no house!");
  452.     }
  453.  
  454.     for (new i = 0; i < MAX_HOUSE; i++)
  455.     {
  456.         if (!houseInfo[i][db_id] || !strlen(houseInfo[i][h_owner])) {
  457.             continue;
  458.         }
  459.  
  460.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  461.         {
  462.             if (strcmp(houseInfo[i][h_owner], PlayerName(playerid), true)) {
  463.                 return SendClientMessage(playerid, COLOR_RED, "This is not your house!");
  464.             }
  465.  
  466.             SetPVarInt(playerid, "HouseID", i);
  467.  
  468.             format(string, sizeof(string), "House checkout: $%i", houseInfo[i][h_checkout]);
  469.             ShowPlayerDialog(playerid, DIALOG_CHECKOUT, DIALOG_STYLE_INPUT, "House checkout", string, "Take off", "Pay in");
  470.             return 1;
  471.         }
  472.     }
  473.     return 1;
  474. }
  475.  
  476. CMD:sellhouse(playerid, params[])
  477. {
  478.     new string[128];
  479.  
  480.     if (IsPlayerHouseOwner(playerid) == 0) {
  481.         return SendClientMessage(playerid, COLOR_RED, "You have no house!");
  482.     }
  483.  
  484.     for (new i = 0; i < MAX_HOUSE; i++)
  485.     {
  486.         if (!houseInfo[i][db_id] || !strlen(houseInfo[i][h_owner])) {
  487.             continue;
  488.         }
  489.  
  490.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  491.         {
  492.             if (strcmp(houseInfo[i][h_owner], PlayerName(playerid), true)) {
  493.                 return SendClientMessage(playerid, COLOR_RED, "This is not your house!");
  494.             }
  495.  
  496.             strmid(houseInfo[i][h_owner], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  497.             houseInfo[i][h_lock] = 1;
  498.             houseInfo[i][h_checkout] = 0;
  499.  
  500.             GivePlayerMoney(playerid, houseInfo[i][h_buyprice]/2);
  501.  
  502.             format(string, sizeof(string), "You sold the House successfully, you will receive $%i.", houseInfo[i][h_buyprice]/2);
  503.             SendClientMessage(playerid, COLOR_BLUE, string);
  504.  
  505.             UpdateHouse(i);
  506.             SaveHouse(i);
  507.             return 1;
  508.         }
  509.     }
  510.     return 1;
  511. }
  512.  
  513. CMD:asellhouse(playerid, params[])
  514. {
  515.     if (!IsPlayerAdmin(playerid)) {
  516.         return SendClientMessage(playerid, COLOR_GREY, "You are no admin!");
  517.     }
  518.  
  519.     for (new i = 0; i < MAX_HOUSE; i++)
  520.     {
  521.         if (!houseInfo[i][db_id] || !strlen(houseInfo[i][h_owner])) {
  522.             continue;
  523.         }
  524.  
  525.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  526.         {
  527.             strmid(houseInfo[i][h_owner], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  528.             houseInfo[i][h_lock] = 1;
  529.             houseInfo[i][h_checkout] = 0;
  530.  
  531.             SendClientMessage(playerid, COLOR_BLUE, "You have successfully freed the House.");
  532.  
  533.             UpdateHouse(i);
  534.             SaveHouse(i);
  535.             return 1;
  536.         }
  537.     }
  538.     return 1;
  539. }
  540.  
  541. CMD:enter(playerid, params[])
  542. {
  543.     for (new i = 0; i < MAX_HOUSE; i++)
  544.     {
  545.         if (!houseInfo[i][db_id] && !strlen(houseInfo[i][h_owner]) || houseInfo[i][h_x] == 0.0) {
  546.             continue;
  547.         }
  548.  
  549.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  550.         {
  551.             if (houseInfo[i][h_lock] == 1) {
  552.                 return SendClientMessage(playerid, COLOR_RED, "This house is completed.");
  553.             }
  554.  
  555.             SetPlayerPos(playerid, houseInfo[i][i_x], houseInfo[i][i_y], houseInfo[i][i_z]);
  556.             SetPlayerInterior(playerid, houseInfo[i][h_interior]);
  557.             SetPlayerVirtualWorld(playerid, i);
  558.             return 1;
  559.         }
  560.     }
  561.     return 1;
  562. }
  563.  
  564. CMD:exit(playerid, params[])
  565. {
  566.     for (new i = 0; i < MAX_HOUSE; i++)
  567.     {
  568.         if (!houseInfo[i][db_id] || GetPlayerVirtualWorld(playerid) != i) {
  569.             continue;
  570.         }
  571.  
  572.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][i_x], houseInfo[i][i_y], houseInfo[i][i_z]))
  573.         {
  574.             SetPlayerPos(playerid, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]);
  575.             SetPlayerInterior(playerid, 0);
  576.             SetPlayerVirtualWorld(playerid, 0);
  577.             return 1;
  578.         }
  579.     }
  580.     return 1;
  581. }
  582.  
  583. CMD:lock(playerid, params[])
  584. {
  585.     if (IsPlayerHouseOwner(playerid) == 0) {
  586.         return SendClientMessage(playerid, COLOR_RED, "You have no house!");
  587.     }
  588.  
  589.     for (new i = 0; i < MAX_HOUSE; i++)
  590.     {
  591.         if (!houseInfo[i][db_id] && !strlen(houseInfo[i][h_owner])) {
  592.             continue;
  593.         }
  594.  
  595.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  596.         {
  597.             if (strcmp(houseInfo[i][h_owner], PlayerName(playerid), true)) {
  598.                 continue;
  599.             }
  600.  
  601.             if (houseInfo[i][h_lock] == 1) {
  602.                 houseInfo[i][h_lock] = 0;
  603.                 GameTextForPlayer(playerid, "~g~Open", 3000, 4);
  604.             }
  605.             else if (houseInfo[i][h_lock] == 0) {
  606.                 houseInfo[i][h_lock] = 1;
  607.                 GameTextForPlayer(playerid, "~r~Closed", 3000, 4);
  608.             }
  609.             return 1;
  610.         }
  611.     }
  612.     return 1;
  613. }
  614.  
  615. CMD:asetprice(playerid, params[])
  616. {
  617.     if (!IsPlayerAdmin(playerid)) {
  618.         return SendClientMessage(playerid, COLOR_GREY, "You are no admin!");
  619.     }
  620.  
  621.     new price, string[128];
  622.  
  623.     if (sscanf(params, "i", price)) {
  624.         return SendClientMessage(playerid, COLOR_GREY, "[Command]: /asetprice [new price]");
  625.     }
  626.  
  627.     if (price < 0) {
  628.         return SendClientMessage(playerid, COLOR_GREY, "The price must be greater than 0!");
  629.     }
  630.  
  631.     for (new i = 0; i < MAX_HOUSE; i++)
  632.     {
  633.         if (!houseInfo[i][db_id]) {
  634.             continue;
  635.         }
  636.  
  637.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  638.         {
  639.             houseInfo[i][h_buyprice] = price;
  640.  
  641.             format(string, sizeof(string), "You set the price to $%i.", price);
  642.             SendClientMessage(playerid, COLOR_RED, string);
  643.  
  644.             UpdateHouse(i);
  645.             SaveHouse(i);
  646.         }
  647.     }
  648.     return 1;
  649. }
  650.  
  651. CMD:asetscore(playerid, params[])
  652. {
  653.     if (!IsPlayerAdmin(playerid)) {
  654.         return SendClientMessage(playerid, COLOR_GREY, "You are no admin!");
  655.     }
  656.  
  657.     new score, string[128];
  658.  
  659.     if (sscanf(params, "i", score)) {
  660.         return SendClientMessage(playerid, COLOR_GREY, "[Command]: /asetscore [new score]");
  661.     }
  662.  
  663.     if (score < 0) {
  664.         return SendClientMessage(playerid, COLOR_GREY, "The score must be greater than 0!");
  665.     }
  666.  
  667.     for (new i = 0; i < MAX_HOUSE; i++)
  668.     {
  669.         if (!houseInfo[i][db_id]) {
  670.             continue;
  671.         }
  672.  
  673.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  674.         {
  675.             houseInfo[i][h_buyscore] = score;
  676.  
  677.             format(string, sizeof(string), "You set the score to %i.", score);
  678.             SendClientMessage(playerid, COLOR_RED, string);
  679.  
  680.             UpdateHouse(i);
  681.             SaveHouse(i);
  682.         }
  683.     }
  684.     return 1;
  685. }
  686.  
  687. CMD:asetcheckout(playerid, params[])
  688. {
  689.     if (!IsPlayerAdmin(playerid)) {
  690.         return SendClientMessage(playerid, COLOR_GREY, "You are no admin!");
  691.     }
  692.  
  693.     new checkout, string[128];
  694.  
  695.     if (sscanf(params, "i", checkout)) {
  696.         return SendClientMessage(playerid, COLOR_GREY, "[Command]: /asetcheckout [new checkout]");
  697.     }
  698.  
  699.     if (checkout < 0) {
  700.         return SendClientMessage(playerid, COLOR_GREY, "The checkout must be greater than 0!");
  701.     }
  702.  
  703.     for (new i = 0; i < MAX_HOUSE; i++)
  704.     {
  705.         if (!houseInfo[i][db_id]) {
  706.             continue;
  707.         }
  708.  
  709.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  710.         {
  711.             houseInfo[i][h_checkout] = checkout;
  712.  
  713.             format(string, sizeof(string), "You set the checkout to $%i.", checkout);
  714.             SendClientMessage(playerid, COLOR_RED, string);
  715.  
  716.             UpdateHouse(i);
  717.             SaveHouse(i);
  718.         }
  719.     }
  720.     return 1;
  721. }
  722.  
  723. CMD:ahousesettings(playerid, params[])
  724. {
  725.     if (!IsPlayerAdmin(playerid)) {
  726.         return SendClientMessage(playerid, COLOR_GREY, "You are no admin!");
  727.     }
  728.  
  729.     new string[128];
  730.  
  731.     for (new i = 0; i < MAX_HOUSE; i++)
  732.     {
  733.         if (!houseInfo[i][db_id]) {
  734.             continue;
  735.         }
  736.  
  737.         if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z]))
  738.         {
  739.             SetPVarInt(playerid, "HouseID", i);
  740.  
  741.             format(string, sizeof(string), "InteriorX\nInteriorY\nInteriorZ\nInteriorID");
  742.             ShowPlayerDialog(playerid, DIALOG_ASETTINGS, DIALOG_STYLE_LIST, "House settings", string, "Select", "Cancel");
  743.             return 1;
  744.         }
  745.     }
  746.     return 1;
  747. }
  748.  
  749. public OnPlayerCommandText(playerid, cmdtext[])
  750. {
  751.     return 0;
  752. }
  753.  
  754. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  755. {
  756.     return 1;
  757. }
  758.  
  759. public OnPlayerExitVehicle(playerid, vehicleid)
  760. {
  761.     return 1;
  762. }
  763.  
  764. public OnPlayerStateChange(playerid, newstate, oldstate)
  765. {
  766.     return 1;
  767. }
  768.  
  769. public OnPlayerEnterCheckpoint(playerid)
  770. {
  771.     return 1;
  772. }
  773.  
  774. public OnPlayerLeaveCheckpoint(playerid)
  775. {
  776.     return 1;
  777. }
  778.  
  779. public OnPlayerEnterRaceCheckpoint(playerid)
  780. {
  781.     return 1;
  782. }
  783.  
  784. public OnPlayerLeaveRaceCheckpoint(playerid)
  785. {
  786.     return 1;
  787. }
  788.  
  789. public OnRconCommand(cmd[])
  790. {
  791.     return 1;
  792. }
  793.  
  794. public OnPlayerRequestSpawn(playerid)
  795. {
  796.     return 1;
  797. }
  798.  
  799. public OnObjectMoved(objectid)
  800. {
  801.     return 1;
  802. }
  803.  
  804. public OnPlayerObjectMoved(playerid, objectid)
  805. {
  806.     return 1;
  807. }
  808.  
  809. public OnPlayerPickUpPickup(playerid, pickupid)
  810. {
  811.     return 1;
  812. }
  813.  
  814. public OnVehicleMod(playerid, vehicleid, componentid)
  815. {
  816.     return 1;
  817. }
  818.  
  819. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  820. {
  821.     return 1;
  822. }
  823.  
  824. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  825. {
  826.     return 1;
  827. }
  828.  
  829. public OnPlayerSelectedMenuRow(playerid, row)
  830. {
  831.     return 1;
  832. }
  833.  
  834. public OnPlayerExitedMenu(playerid)
  835. {
  836.     return 1;
  837. }
  838.  
  839. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  840. {
  841.     return 1;
  842. }
  843.  
  844. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  845. {
  846.     return 1;
  847. }
  848.  
  849. public OnRconLoginAttempt(ip[], password[], success)
  850. {
  851.     return 1;
  852. }
  853.  
  854. public OnPlayerUpdate(playerid)
  855. {
  856.     return 1;
  857. }
  858.  
  859. public OnPlayerStreamIn(playerid, forplayerid)
  860. {
  861.     return 1;
  862. }
  863.  
  864. public OnPlayerStreamOut(playerid, forplayerid)
  865. {
  866.     return 1;
  867. }
  868.  
  869. public OnVehicleStreamIn(vehicleid, forplayerid)
  870. {
  871.     return 1;
  872. }
  873.  
  874. public OnVehicleStreamOut(vehicleid, forplayerid)
  875. {
  876.     return 1;
  877. }
  878.  
  879. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  880. {
  881.     if (dialogid == DIALOG_HOUSESCORE)
  882.     {
  883.         new string[128];
  884.  
  885.         if (response)
  886.         {
  887.             SetPVarInt(playerid, "BuyScore", strval(inputtext));
  888.  
  889.             format(string, sizeof(string), "Score: %i\n\nAt what price should you buy this House?\nPlease select a price:",
  890.             strval(inputtext));
  891.  
  892.             ShowPlayerDialog(playerid, DIALOG_HOUSEPRICE, DIALOG_STYLE_INPUT, "Create house - price", string, "Next", "Back");
  893.             return 1;
  894.         }
  895.         return 1;
  896.     }
  897.     else if (dialogid == DIALOG_HOUSEPRICE)
  898.     {
  899.         new string[128];
  900.  
  901.         if (response)
  902.         {
  903.             SetPVarInt(playerid, "BuyPrice", strval(inputtext));
  904.  
  905.             format(string, sizeof(string), "Score: %i\nPrice: $%i\n\nPlease give it to the first coordinate (X) your interior:",
  906.             GetPVarInt(playerid, "BuyScore"), strval(inputtext));
  907.  
  908.             ShowPlayerDialog(playerid, DIALOG_HOUSEINTX, DIALOG_STYLE_INPUT, "Create house - InteriorX", string, "Next", "Back");
  909.             return 1;
  910.         }
  911.  
  912.         format(string, sizeof(string), "At what level should you buy this House?\nPlease select a level:");
  913.         ShowPlayerDialog(playerid, DIALOG_HOUSESCORE, DIALOG_STYLE_INPUT, "Create house - score", string, "Next", "Cancel");
  914.         return 1;
  915.     }
  916.     else if (dialogid == DIALOG_HOUSEINTX)
  917.     {
  918.         new string[256];
  919.  
  920.         if (response)
  921.         {
  922.             SetPVarFloat(playerid, "hInteriorX", floatstr(inputtext));
  923.  
  924.             format(string, sizeof(string), "Score: %i\nPrice: $%i\nInteriorX: %f\n\nPlease give it to the second coordinate (Y) your interior:",
  925.             GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"), floatstr(inputtext));
  926.  
  927.             ShowPlayerDialog(playerid, DIALOG_HOUSEINTY, DIALOG_STYLE_INPUT, "Create house - InteriorY", string, "Next", "Back");
  928.             return 1;
  929.         }
  930.  
  931.         format(string, sizeof(string), "Score: %i\nAt what price should you buy this House?\nPlease select a price:",
  932.         GetPVarInt(playerid, "BuyScore"));
  933.  
  934.         ShowPlayerDialog(playerid, DIALOG_HOUSEPRICE, DIALOG_STYLE_INPUT, "Create house - price", string, "Next", "Back");
  935.         return 1;
  936.     }
  937.     else if (dialogid == DIALOG_HOUSEINTY)
  938.     {
  939.         new string[256];
  940.  
  941.         if (response)
  942.         {
  943.             SetPVarFloat(playerid, "hInteriorY", floatstr(inputtext));
  944.  
  945.             format(string, sizeof(string), "\
  946.             Score: %i\n\
  947.             Price: $%i\n\
  948.             InteriorX: %f\n\
  949.             InteriorY: %f\n\n\
  950.             Please give it to the third coordinate (Z) your interior:",
  951.             GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"), GetPVarFloat(playerid, "hInteriorX"),
  952.             floatstr(inputtext));
  953.  
  954.             ShowPlayerDialog(playerid, DIALOG_HOUSEINTZ, DIALOG_STYLE_INPUT, "Create house - InteriorZ", string, "Next", "Back");
  955.             return 1;
  956.         }
  957.  
  958.         format(string, sizeof(string), "Score: %i\nPrice: $%i\nPlease give it to the first coordinate (X) your interior:",
  959.         GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"));
  960.  
  961.         ShowPlayerDialog(playerid, DIALOG_HOUSEINTX, DIALOG_STYLE_INPUT, "Create house - InteriorX", string, "Next", "Back");
  962.         return 1;
  963.     }
  964.     else if (dialogid == DIALOG_HOUSEINTZ)
  965.     {
  966.         new string[256];
  967.  
  968.         if (response)
  969.         {
  970.             SetPVarFloat(playerid, "hInteriorZ", floatstr(inputtext));
  971.  
  972.             format(string, sizeof(string), "\
  973.             Score: %i\n\
  974.             Price: $%i\n\
  975.             InteriorX: %f\n\
  976.             InteriorY: %f\n\
  977.             InteriorZ: %f\n\n\
  978.             Please enter the InteriorID:",
  979.             GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"), GetPVarFloat(playerid, "hInteriorX"),
  980.             GetPVarFloat(playerid, "hInteriorY"), floatstr(inputtext));
  981.  
  982.             ShowPlayerDialog(playerid, DIALOG_HOUSEINTERIOR, DIALOG_STYLE_INPUT, "Create house - InteriorID", string, "Next", "Back");
  983.             return 1;
  984.         }
  985.  
  986.         format(string, sizeof(string), "Score: %i\nPrice: $%i\nInteriorX: %f\nPlease give it to the second coordinate (Y) your interior:",
  987.         GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"), GetPVarFloat(playerid, "hInteriorX"));
  988.  
  989.         ShowPlayerDialog(playerid, DIALOG_HOUSEINTY, DIALOG_STYLE_INPUT, "Create house - InteriorY", string, "Next", "Back");
  990.         return 1;
  991.     }
  992.     else if (dialogid == DIALOG_HOUSEINTERIOR)
  993.     {
  994.         new string[256];
  995.  
  996.         if (response)
  997.         {
  998.             SetPVarInt(playerid, "hInterior", strval(inputtext));
  999.  
  1000.             format(string, sizeof(string), "\
  1001.             Score: %i\n\
  1002.             Price: $%i\n\
  1003.             InteriorX: %f\n\
  1004.             InteriorY: %f\n\
  1005.             InteriorZ: %f\n\
  1006.             InteriorID: %i\n\n\
  1007.             Would you really build this House?",
  1008.             GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"), GetPVarFloat(playerid, "hInteriorX"),
  1009.             GetPVarFloat(playerid, "hInteriorY"), GetPVarFloat(playerid, "hInteriorZ"), strval(inputtext));
  1010.  
  1011.             ShowPlayerDialog(playerid, DIALOG_HOUSECONFIRM, DIALOG_STYLE_MSGBOX, "Create house", string, "Accept", "Back");
  1012.             return 1;
  1013.         }
  1014.  
  1015.         format(string, sizeof(string), "\
  1016.         Score: %i\n\
  1017.         Price: $%i\n\
  1018.         InteriorX: %f\n\
  1019.         InteriorY: %f\n\n\
  1020.         Please give it to the third coordinate (Z) your interior:",
  1021.         GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"), GetPVarFloat(playerid, "hInteriorX"),
  1022.         GetPVarFloat(playerid, "hInteriorY"));
  1023.  
  1024.         ShowPlayerDialog(playerid, DIALOG_HOUSEINTZ, DIALOG_STYLE_INPUT, "Create house - InteriorZ", string, "Next", "Back");
  1025.         return 1;
  1026.     }
  1027.     else if (dialogid == DIALOG_HOUSECONFIRM)
  1028.     {
  1029.         new string[356];
  1030.  
  1031.         if (response)
  1032.         {
  1033.             new Float:px, Float:py, Float:pz, query[364];
  1034.  
  1035.             new id = GetFreeHouseID();
  1036.  
  1037.             GetPlayerPos(playerid, px, py, pz);
  1038.  
  1039.             for (new i = 0; i < MAX_HOUSE; i++) {
  1040.                 if (!houseInfo[i][db_id]) continue;
  1041.  
  1042.                 if (IsPlayerInRangeOfPoint(playerid, 2.0, houseInfo[i][h_x], houseInfo[i][h_y], houseInfo[i][h_z])) {
  1043.                     return SendClientMessage(playerid, COLOR_GREY, "You can create no houses next to each other.");
  1044.                 }
  1045.             }
  1046.  
  1047.             strmid(houseInfo[id][h_owner], "", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  1048.             houseInfo[id][h_interior] = GetPVarInt(playerid, "hInterior");
  1049.             houseInfo[id][h_buyscore] = GetPVarInt(playerid, "BuyScore");
  1050.             houseInfo[id][h_buyprice] = GetPVarInt(playerid, "BuyPrice");
  1051.             houseInfo[id][h_lock] = 1;
  1052.             houseInfo[id][h_checkout] = 0;
  1053.             houseInfo[id][h_x] = px;
  1054.             houseInfo[id][h_y] = py;
  1055.             houseInfo[id][h_z] = pz;
  1056.             houseInfo[id][i_x] = GetPVarFloat(playerid, "hInteriorX");
  1057.             houseInfo[id][i_y] = GetPVarFloat(playerid, "hInteriorY");
  1058.             houseInfo[id][i_z] = GetPVarFloat(playerid, "hInteriorZ");
  1059.  
  1060.  
  1061.             format(query, sizeof(query), "INSERT INTO `houses` (interior, buyscore, buyprice, h_lock, checkout, h_x, h_y, h_z,\
  1062.             i_x, i_y, i_z) VALUES ('%i', '%i', '%i', '1', '0', '%f', '%f', '%f', '%f', '%f', '%f')",
  1063.             houseInfo[id][h_interior],
  1064.             houseInfo[id][h_buyscore],
  1065.             houseInfo[id][h_buyprice],
  1066.             houseInfo[id][h_x],
  1067.             houseInfo[id][h_y],
  1068.             houseInfo[id][h_z],
  1069.             houseInfo[id][i_x],
  1070.             houseInfo[id][i_y],
  1071.             houseInfo[id][i_z]);
  1072.  
  1073.             print(query);
  1074.  
  1075.             mysql_function_query(handle, query, true, "CreateHouse", "i", id);
  1076.             UpdateHouse(id);
  1077.  
  1078.             format(string, sizeof(string), "You have a House created successfully, HouseID: %i", houseInfo[id][db_id]);
  1079.             SendClientMessage(playerid, COLOR_RED, string);
  1080.             return 1;
  1081.         }
  1082.  
  1083.         format(string, sizeof(string), "\
  1084.         Score: %i\n\
  1085.         Price: $%i\n\
  1086.         InteriorX: %f\n\
  1087.         InteriorY: %f\n\
  1088.         InteriorZ: %f\n\n\
  1089.         Please enter the InteriorID:",
  1090.         GetPVarInt(playerid, "BuyScore"), GetPVarInt(playerid, "BuyPrice"), GetPVarFloat(playerid, "hInteriorX"),
  1091.         GetPVarFloat(playerid, "hInteriorY"), GetPVarFloat(playerid, "hInteriorZ"));
  1092.  
  1093.         ShowPlayerDialog(playerid, DIALOG_HOUSEINTERIOR, DIALOG_STYLE_INPUT, "Create house - InteriorID", string, "Next", "Back");
  1094.         return 1;
  1095.     }
  1096.     else if (dialogid == DIALOG_CHECKOUT)
  1097.     {
  1098.         new id = GetPVarInt(playerid, "HouseID");
  1099.  
  1100.         if (response)
  1101.         {
  1102.             if (houseInfo[id][h_checkout] < strval(inputtext)) {
  1103.                 return SendClientMessage(playerid, COLOR_RED, "Your house checkout has not enough money");
  1104.             }
  1105.  
  1106.             houseInfo[id][h_checkout] -= strval(inputtext);
  1107.             GivePlayerMoney(playerid, strval(inputtext));
  1108.         }
  1109.         else if (!response)
  1110.         {
  1111.             if (GetPlayerMoney(playerid) < strval(inputtext)) {
  1112.                 return SendClientMessage(playerid, COLOR_RED, "You have not enough money!");
  1113.             }
  1114.  
  1115.             houseInfo[id][h_checkout] += strval(inputtext);
  1116.             GivePlayerMoney(playerid, -strval(inputtext));
  1117.         }
  1118.  
  1119.         SaveHouse(id);
  1120.         return 1;
  1121.     }
  1122.     else if (dialogid == DIALOG_AHOUSEINTX)
  1123.     {
  1124.         if (response)
  1125.         {
  1126.             new string[128];
  1127.             new id = GetPVarInt(playerid, "HouseID");
  1128.  
  1129.             houseInfo[id][i_x] = floatstr(inputtext);
  1130.  
  1131.             format(string, sizeof(string), "InteriorX\nInteriorY\nInteriorZ\nInteriorID");
  1132.             ShowPlayerDialog(playerid, DIALOG_ASETTINGS, DIALOG_STYLE_LIST, "House settings", string, "Select", "Cancel");
  1133.             return 1;
  1134.         }
  1135.         return 1;
  1136.     }
  1137.     else if (dialogid == DIALOG_AHOUSEINTY)
  1138.     {
  1139.         if (response)
  1140.         {
  1141.             new string[128];
  1142.             new id = GetPVarInt(playerid, "HouseID");
  1143.  
  1144.             houseInfo[id][i_y] = floatstr(inputtext);
  1145.  
  1146.             format(string, sizeof(string), "InteriorX\nInteriorY\nInteriorZ\nInteriorID");
  1147.             ShowPlayerDialog(playerid, DIALOG_ASETTINGS, DIALOG_STYLE_LIST, "House settings", string, "Select", "Cancel");
  1148.             return 1;
  1149.         }
  1150.         return 1;
  1151.     }
  1152.     else if (dialogid == DIALOG_AHOUSEINTZ)
  1153.     {
  1154.         if (response)
  1155.         {
  1156.             new string[128];
  1157.             new id = GetPVarInt(playerid, "HouseID");
  1158.  
  1159.             houseInfo[id][i_z] = floatstr(inputtext);
  1160.  
  1161.             format(string, sizeof(string), "InteriorX\nInteriorY\nInteriorZ\nInteriorID");
  1162.             ShowPlayerDialog(playerid, DIALOG_ASETTINGS, DIALOG_STYLE_LIST, "House settings", string, "Select", "Cancel");
  1163.             return 1;
  1164.         }
  1165.         return 1;
  1166.     }
  1167.     else if (dialogid == DIALOG_AHOUSEINTERIOR)
  1168.     {
  1169.         if (response)
  1170.         {
  1171.             new string[128];
  1172.             new id = GetPVarInt(playerid, "HouseID");
  1173.  
  1174.             houseInfo[id][h_interior] = strval(inputtext);
  1175.  
  1176.             format(string, sizeof(string), "InteriorX\nInteriorY\nInteriorZ\nInteriorID");
  1177.             ShowPlayerDialog(playerid, DIALOG_ASETTINGS, DIALOG_STYLE_LIST, "House settings", string, "Select", "Cancel");
  1178.             return 1;
  1179.         }
  1180.         return 1;
  1181.     }
  1182.     else if (dialogid == DIALOG_ASETTINGS)
  1183.     {
  1184.         if (response)
  1185.         {
  1186.             new string[128];
  1187.  
  1188.             switch (listitem)
  1189.             {
  1190.                 case 0:
  1191.                 {
  1192.                     format(string, sizeof(string), "Please give it to the first coordinate (X) your interior:");
  1193.                     ShowPlayerDialog(playerid, DIALOG_AHOUSEINTX, DIALOG_STYLE_INPUT, "House settings - InteriorX", string, "Okay", "Cancel");
  1194.                 }
  1195.                 case 1:
  1196.                 {
  1197.                     format(string, sizeof(string), "Please give it to the second coordinate (Y) your interior:");
  1198.                     ShowPlayerDialog(playerid, DIALOG_AHOUSEINTY, DIALOG_STYLE_INPUT, "House settings - InteriorY", string, "Okay", "Cancel");              }
  1199.                 case 2:
  1200.                 {
  1201.                     format(string, sizeof(string), "Please give it to the third coordinate (Z) your interior:");
  1202.                     ShowPlayerDialog(playerid, DIALOG_AHOUSEINTZ, DIALOG_STYLE_INPUT, "House settings - InteriorZ", string, "Okay", "Cancel");
  1203.                 }
  1204.                 case 3:
  1205.                 {
  1206.                     format(string, sizeof(string), "Please enter the InteriorID:");
  1207.                     ShowPlayerDialog(playerid, DIALOG_AHOUSEINTERIOR, DIALOG_STYLE_INPUT, "House settings - InteriorID", string, "Okay", "Cancel");
  1208.                 }
  1209.             }
  1210.         }
  1211.     }
  1212.     return 1;
  1213. }
  1214.  
  1215. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1216. {
  1217.     return 1;
  1218. }
Advertisement
Add Comment
Please, Sign In to add comment