Advertisement
Guest User

Comanda Createhouse

a guest
Jul 12th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.13 KB | None | 0 0
  1. CMD:createhouse(playerid, params[])
  2. {
  3. new Float:Pos[3], Float:IntPos[3], inter, ivInt, ivPrice, ivLevel;
  4. if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
  5. if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
  6. if(sscanf(params,"iii",ivLevel,ivPrice,ivInt)) return SendClientMessage(playerid, COLOR_SYN, "Tasteaza:{FFFFFF} /createhouse <level> <price> <intid>");
  7. {
  8. if(ivLevel < 1 || ivLevel > 50) return 1;
  9. if(ivPrice < 1 || ivPrice > 100000000) return 1;
  10. if(ivInt < 1 || ivInt > 42) return 1;
  11. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  12.  
  13. if(ivInt == 1)IntPos[0] = 140.17, IntPos[1] = 1366.07, IntPos[2] = 1083.65, inter = 5;
  14. else if(ivInt == 2)IntPos[0] = 2324.53, IntPos[1] = -1149.54, IntPos[2] = 1050.71, inter = 12;
  15. else if(ivInt == 3)IntPos[0] = 225.68, IntPos[1] = 1021.45, IntPos[2] = 1084.02, inter = 7;
  16. else if(ivInt == 4) IntPos[0] = 234.19, IntPos[1] = 1063.73, IntPos[2] = 1084.21, inter = 6;
  17. else if(ivInt == 5) IntPos[0] = 226.30, IntPos[1] = 1114.24, IntPos[2] = 1080.99, inter = 5;
  18. else if(ivInt == 6) IntPos[0] = 235.34, IntPos[1] = 1186.68, IntPos[2] = 1080.26, inter = 3;
  19. else if(ivInt == 7) IntPos[0] = 491.07, IntPos[1] = 1398.50, IntPos[2] = 1080.26, inter = 2;
  20. else if(ivInt == 8) IntPos[0] = 24.04, IntPos[1] = 1340.17, IntPos[2] = 1084.38, inter = 10;
  21. else if(ivInt == 9) IntPos[0] = -283.44, IntPos[1] = 1470.93, IntPos[2] = 1084.38, inter = 15;
  22. else if(ivInt == 10) IntPos[0] = -260.49, IntPos[1] = 1456.75, IntPos[2] = 1084.37, inter = 4;
  23. else if(ivInt == 11) IntPos[0] = 83.03, IntPos[1] = 1322.28, IntPos[2] = 1083.87, inter = 9;
  24. else if(ivInt == 12) IntPos[0] = 2317.89, IntPos[1] = -1026.76, IntPos[2] = 1050.22, inter = 9;
  25. else if(ivInt == 13) IntPos[0] = 2495.98, IntPos[1] = -1692.08, IntPos[2] = 1014.74, inter = 3;
  26. else if(ivInt == 14) IntPos[0] = 2807.48, IntPos[1] = -1174.76, IntPos[2] = 1025.57, inter = 8;
  27. else if(ivInt == 15) IntPos[0] = 2196.85, IntPos[1] = -1204.25, IntPos[2] = 1049.02, inter = 6;
  28. else if(ivInt == 16) IntPos[0] = 377.15, IntPos[1] = 1417.41, IntPos[2] = 1081.33, inter = 15;
  29. else if(ivInt == 17) IntPos[0] = 2270.38, IntPos[1] = -1210.35, IntPos[2] = 1047.56, inter = 10;
  30. else if(ivInt == 18) IntPos[0] = 446.99, IntPos[1] = 1397.07, IntPos[2] = 1084.30, inter = 2;
  31. else if(ivInt == 19) IntPos[0] = 387.22, IntPos[1] = 1471.70, IntPos[2] = 1080.19, inter = 15;
  32. else if(ivInt == 20) IntPos[0] = 22.88, IntPos[1] = 1403.33, IntPos[2] = 1084.44, inter = 5;
  33. else if(ivInt == 21) IntPos[0] = 2365.31, IntPos[1] = -1135.60, IntPos[2] = 1050.88, inter = 8;
  34. else if(ivInt == 22) IntPos[0] = 2237.59, IntPos[1] = -1081.64, IntPos[2] = 1049.02, inter = 2;
  35. else if(ivInt == 23) IntPos[0] = 295.04, IntPos[1] = 1472.26, IntPos[2] = 1080.26, inter = 15;
  36. else if(ivInt == 24) IntPos[0] = 261.12, IntPos[1] = 1284.30, IntPos[2] = 1080.26, inter = 4;
  37. else if(ivInt == 25) IntPos[0] = 221.92, IntPos[1] = 1140.20, IntPos[2] = 1082.61, inter = 4;
  38. else if(ivInt == 26) IntPos[0] = -68.81, IntPos[1] = 1351.21, IntPos[2] = 1080.21, inter = 6;
  39. else if(ivInt == 27) IntPos[0] = 260.85, IntPos[1] = 1237.24, IntPos[2] = 1084.26, inter = 9;
  40. else if(ivInt == 28) IntPos[0] = 2468.84, IntPos[1] = -1698.24, IntPos[2] = 1013.51, inter = 2;
  41. else if(ivInt == 29) IntPos[0] = 223.20, IntPos[1] = 1287.08, IntPos[2] = 1082.14, inter = 1;
  42. else if(ivInt == 30) IntPos[0] = 2283.04, IntPos[1] = -1140.28, IntPos[2] = 1050.90, inter = 11;
  43. else if(ivInt == 31) IntPos[0] = 328.05, IntPos[1] = 1477.73, IntPos[2] = 1084.44, inter = 15;
  44. else if(ivInt == 32) IntPos[0] = 223.20, IntPos[1] = 1287.08, IntPos[2] = 1287.08, inter = 1;
  45. else if(ivInt == 33) IntPos[0] = -42.59, IntPos[1] = 1405.47, IntPos[2] = 1084.43, inter = 8;
  46. else if(ivInt == 34) IntPos[0] = 446.90, IntPos[1] = 506.35, IntPos[2] = 1001.42, inter = 12;
  47. else if(ivInt == 35) IntPos[0] = 299.78, IntPos[1] = 309.89, IntPos[2] = 1003.30, inter = 4;
  48. else if(ivInt == 36) IntPos[0] = 2308.77, IntPos[1] = -1212.94, IntPos[2] = 1049.02, inter = 6;
  49. else if(ivInt == 37) IntPos[0] = 2233.64, IntPos[1] = -1115.26, IntPos[2] = 1050.88, inter = 5;
  50. else if(ivInt == 38) IntPos[0] = 2218.40, IntPos[1] = -1076.18, IntPos[2] = 1050.48, inter = 1;
  51. else if(ivInt == 39) IntPos[0] = 266.50, IntPos[1] = 304.90, IntPos[2] = 999.15, inter = 2;
  52. else if(ivInt == 40) IntPos[0] = 243.72, IntPos[1] = 304.91, IntPos[2] = 999.15, inter = 1;
  53. else if(ivInt == 41) IntPos[0] = 343.81, IntPos[1] = 304.86, IntPos[2] = 999.15, inter = 6;
  54. else if(ivInt == 42) IntPos[0] = 2259.38, IntPos[1] = -1135.77, IntPos[2] = 1050.64, inter = 10;
  55.  
  56. ++ Total_House_Created;
  57.  
  58. new house = Total_House_Created;
  59.  
  60. HouseInfo[house][hEntranceX] = Pos[0];
  61. HouseInfo[house][hEntranceY] = Pos[1];
  62. HouseInfo[house][hEntranceZ] = Pos[2];
  63. HouseInfo[house][hExitX] = IntPos[0];
  64. HouseInfo[house][hExitY] = IntPos[1];
  65. HouseInfo[house][hExitZ] = IntPos[2];
  66. strmid(HouseInfo[house][hOwner], "The State", 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
  67. HouseInfo[house][hValue] = ivPrice;
  68. HouseInfo[house][hInt] = inter;
  69. HouseInfo[house][hLock] = 1;
  70. HouseInfo[house][hOwned] = 0;
  71. HouseInfo[house][hRent] = 1;
  72. HouseInfo[house][hRentable] = 0;
  73. HouseInfo[house][hSafe] = 0;
  74. HouseInfo[house][hLevel] = ivLevel;
  75. HouseInfo[house][hWorld] = Total_House_Created;
  76. HouseInfo[house][hSellPrice] = 0;
  77.  
  78. gQuery[0] = (EOS);
  79. mysql_format(handle, gQuery, sizeof(gQuery) ,"INSERT INTO `houses` (`ID`,`EntranceX`,`EntranceY`,`EntranceZ`,`ExitX`,`ExitY`,`ExitZ`,`Owner`,`Value`,`Interior`,`Lock`,`Owned`,`Rent`,`Rentable`,`Safe`,`Level`,`World`) VALUES (%d,%f,%f,%f,%f,%f,%f,'%e',%d,%d,%d,%d,%d,%d,%d,%d,%d)",
  80. Total_House_Created,
  81. HouseInfo[house][hEntranceX],
  82. HouseInfo[house][hEntranceY],
  83. HouseInfo[house][hEntranceZ],
  84. HouseInfo[house][hExitX],
  85. HouseInfo[house][hExitY],
  86. HouseInfo[house][hExitZ],
  87. HouseInfo[house][hOwner],
  88. HouseInfo[house][hValue],
  89. HouseInfo[house][hInt],
  90. HouseInfo[house][hLock],
  91. HouseInfo[house][hOwned],
  92. HouseInfo[house][hRent],
  93. HouseInfo[house][hRentable],
  94. HouseInfo[house][hSafe],
  95. HouseInfo[house][hLevel],
  96. HouseInfo[house][hWorld]);
  97. mysql_query(handle ,gQuery);
  98.  
  99. format(gString, sizeof(gString), "House %d\nAceasta casa este la vanzare!\nPrice: {FFFFFF}$%s\n{FF9933}Level: {FFFFFF}%d\n{FF9933}Pentru a cumpara aceasta casa,Foloseste comanda /buyhouse.",house,FormatNumber(HouseInfo[house][hValue]),HouseInfo[house][hLevel]);
  100. HouseInfo[house][hTextInfo] = CreateDynamic3DTextLabel(gString,0xFF9933FF,HouseInfo[house][hEntranceX], HouseInfo[house][hEntranceY], HouseInfo[house][hEntranceZ]+0.5,15, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 15.0);
  101. HouseInfo[house][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[house][hEntranceX], HouseInfo[house][hEntranceY], HouseInfo[house][hEntranceZ], -1, -1, -1, 15.0);
  102. HouseInfo[house][hMapIcon] = CreateDynamicMapIcon(HouseInfo[house][hEntranceX], HouseInfo[house][hEntranceY], HouseInfo[house][hEntranceZ], 31, -1, -1, -1, -1, 30.0);
  103. }
  104. return 1;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement