Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. dcmd_createhouse(playerid, params[])
  2. {
  3. #pragma unused params
  4. new Float:X, Float:Y, Float:Z; new hid = 0;
  5. new cijena, level, entr;
  6. if(IsPlayerAdmin(playerid))
  7. {
  8. if(sscanf(params, "iii",cijena, level, entr))
  9. {
  10. SendClientMessage(playerid, GRAY, "Koriscenje: /createhouse [cena] [level] [enterijer]");
  11. return 1;
  12. }
  13. GetPlayerPos(playerid, X,Y,Z);
  14. for(new h = 1; h < sizeof(HouseInfo); h++)
  15. {
  16. if(HouseInfo[h][hAppointed] == 1)
  17. {
  18. hid = h + 1;
  19. }
  20. if(hid == 0)
  21. {
  22. hid = 1;
  23. }
  24. }
  25. if(entr < 1 || entr > 5)
  26. {
  27. SendClientMessage(playerid, COLOR_GREY, "Enterijer ne moze biti manji od 1 ni veci od 5.");
  28. return 1;
  29. }
  30. format(HouseInfo[hid][hOwner], 24, "%s", "Drzava");
  31. HouseInfo[hid][hEnterX] = X;
  32. HouseInfo[hid][hEnterY] = Y;
  33. HouseInfo[hid][hEnterZ] = Z;
  34. HouseInfo[hid][hOwned] = 0;
  35. HouseInfo[hid][hAppointed] = 1;
  36. HouseInfo[hid][hLocked] = 0;
  37. HouseInfo[hid][hMoney] = 0;
  38. HouseInfo[hid][hMats] = 0;
  39. HouseInfo[hid][hDrugs] = 0;
  40. HouseInfo[hid][hGun] = 0;
  41. HouseInfo[hid][hGunAmmo] = 0;
  42. HouseInfo[hid][hPrice] = cijena;
  43. HouseInfo[hid][hLevel] = level;
  44. TPUpdate(hid);
  45. SaveHouses();
  46. SendClientMessage(playerid, COLOR_WHITE, "Napravili ste novu kucu!");
  47. if(entr == 1)
  48. {
  49. HouseInfo[hid][hExitX] = 2308.7400;
  50. HouseInfo[hid][hExitY] = -1212.4301;
  51. HouseInfo[hid][hExitZ] = 1049.0234;
  52. HouseInfo[hid][hInt] = 6;
  53. SaveHouses();
  54. return 1;
  55. }
  56. else if(entr == 2)
  57. {
  58. HouseInfo[hid][hExitX] = 244.4120;
  59. HouseInfo[hid][hExitY] = 305.0330;
  60. HouseInfo[hid][hExitZ] = 999.1484;
  61. HouseInfo[hid][hInt] = 1;
  62. SaveHouses();
  63. return 1;
  64. }
  65. else if(entr == 3)
  66. {
  67. HouseInfo[hid][hExitX] = 267.1469;
  68. HouseInfo[hid][hExitY] = 304.9806;
  69. HouseInfo[hid][hExitZ] = 999.1484;
  70. HouseInfo[hid][hInt] = 2;
  71. SaveHouses();
  72. return 1;
  73. }
  74. else if(entr == 4)
  75. {
  76. HouseInfo[hid][hExitX] = 2259.9094;
  77. HouseInfo[hid][hExitY] = -1135.8812;
  78. HouseInfo[hid][hExitZ] = 1050.6328;
  79. HouseInfo[hid][hInt] = 10;
  80. SaveHouses();
  81. return 1;
  82. }
  83. else if(entr == 5)
  84. {
  85. HouseInfo[hid][hExitX] = 318.5494;
  86. HouseInfo[hid][hExitY] = 1115.0696;
  87. HouseInfo[hid][hExitZ] = 1083.8828;
  88. HouseInfo[hid][hInt] = 5;
  89. SaveHouses();
  90. return 1;
  91. }
  92. }
  93. return 1;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement