Guest User

Untitled

a guest
May 21st, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.11 KB | None | 0 0
  1. YCMD:kreirajvik(playerid,params[], help)
  2. {
  3. #pragma unused params
  4. #pragma unused help
  5. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Samo admini!");
  6. new Sell, lvl, vrsta;
  7. if(sscanf(params, "iii", Sell, lvl , vrsta))
  8. {
  9. SendClientMessage(playerid, -1, "/kreirajvik [cena] [lvl] [vrsta]");
  10. return true;
  11. }
  12. if(Sell < 5000 || Sell > 50000) return SendClientMessage(playerid, -1, "Cena izmedju 5k i 50k");
  13. if(lvl < 2 || lvl > 12) return SendClientMessage(playerid, -1, "Level izmedju 2 i 12");
  14. if((NekoristeniIDVik()-1) >= Max_Vikendica) return SendClientMessage(playerid, -1, ""zuta" Vikendica:"zelena" Max vikendica postoji!");
  15. new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
  16. new sledeci = NekoristeniIDVik();
  17. format(fajlVikendice, sizeof(fajlVikendice), "/Vikendice/%d.json", sledeci);
  18. if(!fexist(fajlVikendice))
  19. {
  20. switch(vrsta)
  21. {
  22. case 1: // Small/1 story/1 bedroom
  23. {
  24. djCreateFile(fajlVikendice);
  25. djSet(fajlVikendice, "Vlasnik", "DRZAVA");
  26. djSetInt(fajlVikendice, "Na_Prodaju", 1);
  27. djSetInt(fajlVikendice, "Cena", Sell);
  28. djSetInt(fajlVikendice, "Rent", 10);
  29. djSetInt(fajlVikendice, "Level", lvl);
  30. djSetFloat(fajlVikendice,"X", X);
  31. djSetFloat(fajlVikendice,"Y", Y);
  32. djSetFloat(fajlVikendice,"Z", Z);
  33. djSetInt(fajlVikendice, "VW", sledeci+1);
  34. djSetInt(fajlVikendice, "Zakljucana", 0);
  35. djSetFloat(fajlVikendice, "IntXStana",225.756989);
  36. djSetFloat(fajlVikendice, "IntYStana",1240.000000);
  37. djSetFloat(fajlVikendice, "IntZStana",1082.149902);
  38. djSetInt(fajlVikendice, "IntIDStana",2);
  39. djAutocommit(true);
  40. UcitajVIkendice(sledeci);
  41. SendClientMessage(playerid, -1, " Vikendica napravljena!");
  42. }
  43.  
  44. case 2: // Small/1 story/1 bedroom
  45. {
  46. djCreateFile(fajlVikendice);
  47. djSet(fajlVikendice, "Vlasnik", "DRZAVA");
  48. djSetInt(fajlVikendice, "Na_Prodaju", 1);
  49. djSetInt(fajlVikendice, "Cena", Sell);
  50. djSetInt(fajlVikendice, "Rent", 10);
  51. djSetInt(fajlVikendice, "Level", lvl);
  52. djSetFloat(fajlVikendice,"X", X);
  53. djSetFloat(fajlVikendice,"Y", Y);
  54. djSetFloat(fajlVikendice,"Z", Z);
  55. djSetInt(fajlVikendice, "VW", sledeci+1);
  56. djSetInt(fajlVikendice, "Zakljucana", 0);
  57. djSetFloat(fajlVikendice, "IntXStana",328.493988);
  58. djSetFloat(fajlVikendice, "IntYStana",1480.589966);
  59. djSetFloat(fajlVikendice, "IntZStana",1084.449951);
  60. djSetInt(fajlVikendice, "IntIDStana",15);
  61. djAutocommit(true);
  62. UcitajVIkendice(sledeci);
  63. SendClientMessage(playerid, -1, " Vikendica napravljena!");
  64. }
  65.  
  66. case 3: // Small/1 story/1 bedroom
  67. {
  68. djCreateFile(fajlVikendice);
  69. djSet(fajlVikendice, "Vlasnik", "DRZAVA");
  70. djSetInt(fajlVikendice, "Na_Prodaju", 1);
  71. djSetInt(fajlVikendice, "Cena", Sell);
  72. djSetInt(fajlVikendice, "Rent", 10);
  73. djSetInt(fajlVikendice, "Level", lvl);
  74. djSetFloat(fajlVikendice,"X", X);
  75. djSetFloat(fajlVikendice,"Y", Y);
  76. djSetFloat(fajlVikendice,"Z", Z);
  77. djSetInt(fajlVikendice, "VW", sledeci+1);
  78. djSetInt(fajlVikendice, "Zakljucana", 0);
  79. djSetFloat(fajlVikendice, "IntXStana",223.043991);
  80. djSetFloat(fajlVikendice, "IntYStana",1289.259888);
  81. djSetFloat(fajlVikendice, "IntZStana",1082.199951);
  82. djSetInt(fajlVikendice, "IntIDStana",1);
  83. djAutocommit(true);
  84. UcitajVIkendice(sledeci);
  85. SendClientMessage(playerid, -1, " Vikendica napravljena!");
  86. }
  87.  
  88. case 4: // Small/1 story/1 bedroom
  89. {
  90. djCreateFile(fajlVikendice);
  91. djSet(fajlVikendice, "Vlasnik", "DRZAVA");
  92. djSetInt(fajlVikendice, "Na_Prodaju", 1);
  93. djSetInt(fajlVikendice, "Cena", Sell);
  94. djSetInt(fajlVikendice, "Rent", 10);
  95. djSetInt(fajlVikendice, "Level", lvl);
  96. djSetFloat(fajlVikendice,"X", X);
  97. djSetFloat(fajlVikendice,"Y", Y);
  98. djSetFloat(fajlVikendice,"Z", Z);
  99. djSetInt(fajlVikendice, "VW", sledeci+1);
  100. djSetInt(fajlVikendice, "Zakljucana", 0);
  101. djSetFloat(fajlVikendice, "IntXStana",385.803986);
  102. djSetFloat(fajlVikendice, "IntYStana",1471.769897);
  103. djSetFloat(fajlVikendice, "IntZStana",1080.209961);
  104. djSetInt(fajlVikendice, "IntIDStana",15);
  105. djAutocommit(true);
  106. UcitajVIkendice(sledeci);
  107. SendClientMessage(playerid, -1, " Vikendica napravljena!");
  108. }
  109.  
  110.  
  111. }
  112. }
  113. return true;
  114. }
  115.  
  116.  
  117.  
  118. YCMD:kreirajstan(playerid,params[], help)
  119. {
  120. #pragma unused params
  121. #pragma unused help
  122. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Samo admini!");
  123. new Sell, lvl, vrsta;
  124. if(sscanf(params, "iii", Sell, lvl , vrsta))
  125. {
  126. SendClientMessage(playerid, -1, "[USAGE]: /kreirajstan [cena] [lvl] [vrsta]");
  127. return true;
  128. }
  129. if(Sell < 5000 || Sell > 50000) return SendClientMessage(playerid, -1, "Cena izmedju 5k i 50k!");
  130. if(lvl < 2 || lvl > 12) return SendClientMessage(playerid, -1, "Level izmedju 2 i 12!");
  131. if((NekoristeniIDStana()-1) >= Max_Stanova) return SendClientMessage(playerid, -1, ""zuta" Stan:"zelena" Max stanova postoji.");
  132. new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
  133. new sledeci = NekoristeniIDStana();
  134. format(fajlstana, sizeof(fajlstana), "/Stanovi/%d.json", sledeci);
  135. if(!fexist(fajlstana))
  136. {
  137. switch(vrsta)
  138. {
  139. case 1: // Small/1 story/1 bedroom
  140. {
  141. djCreateFile(fajlstana);
  142. djSet(fajlstana, "Vlasnik", "DRZAVA");
  143. djSetInt(fajlstana, "Na_Prodaju", 1);
  144. djSetInt(fajlstana, "Cena", Sell);
  145. djSetInt(fajlstana, "Rent", 10);
  146. djSetInt(fajlstana, "Level", lvl);
  147. djSetFloat(fajlstana,"X", X);
  148. djSetFloat(fajlstana,"Y", Y);
  149. djSetFloat(fajlstana,"Z", Z);
  150. djSetInt(fajlstana, "VW", sledeci+1);
  151. djSetInt(fajlstana, "Zakljucana", 0);
  152. djSetFloat(fajlstana, "IntXStana",1523.509887);
  153. djSetFloat(fajlstana, "IntYStana",-47.821197);
  154. djSetFloat(fajlstana, "IntZStana",1002.130981);
  155. djSetInt(fajlstana, "IntIDStana",2);
  156. djAutocommit(true);
  157. UcitajStanove(sledeci);
  158. SendClientMessage(playerid, -1, " Stan napravljen!");
  159. }
  160.  
  161.  
  162.  
  163. case 2: // Small/1 story/1 bedroom
  164. {
  165. djCreateFile(fajlstana);
  166. djSet(fajlstana, "Vlasnik", "DRZAVA");
  167. djSetInt(fajlstana, "Na_Prodaju", 1);
  168. djSetInt(fajlstana, "Cena", Sell);
  169. djSetInt(fajlstana, "Rent", 10);
  170. djSetInt(fajlstana, "Level", lvl);
  171. djSetFloat(fajlstana,"X", X);
  172. djSetFloat(fajlstana,"Y", Y);
  173. djSetFloat(fajlstana,"Z", Z);
  174. djSetInt(fajlstana, "VW", sledeci+1);
  175. djSetInt(fajlstana, "Zakljucana", 0);
  176. djSetFloat(fajlstana, "IntXStana",1527.229980);
  177. djSetFloat(fajlstana, "IntYStana",-11.574499);
  178. djSetFloat(fajlstana, "IntZStana",1002.097106);
  179. djSetInt(fajlstana, "IntIDStana",3);
  180. djAutocommit(true);
  181. UcitajStanove(sledeci);
  182. SendClientMessage(playerid, -1, " Stan napravljen!");
  183. }
  184.  
  185.  
  186. case 3: // Small/1 story/1 bedroom
  187. {
  188. djCreateFile(fajlstana);
  189. djSet(fajlstana, "Vlasnik", "DRZAVA");
  190. djSetInt(fajlstana, "Na_Prodaju", 1);
  191. djSetInt(fajlstana, "Cena", Sell);
  192. djSetInt(fajlstana, "Rent", 10);
  193. djSetInt(fajlstana, "Level", lvl);
  194. djSetFloat(fajlstana,"X", X);
  195. djSetFloat(fajlstana,"Y", Y);
  196. djSetFloat(fajlstana,"Z", Z);
  197. djSetInt(fajlstana, "VW", sledeci+1);
  198. djSetInt(fajlstana, "Zakljucana", 0);
  199. djSetFloat(fajlstana, "IntXStana",271.884979);
  200. djSetFloat(fajlstana, "IntYStana",306.631988);
  201. djSetFloat(fajlstana, "IntZStana",999.148437);
  202. djSetInt(fajlstana, "IntIDStana",2);
  203. djAutocommit(true);
  204. UcitajStanove(sledeci);
  205. SendClientMessage(playerid, -1, " Stan napravljen!");
  206. }
  207.  
  208.  
  209. case 4: // Small/1 story/1 bedroom
  210. {
  211. djCreateFile(fajlstana);
  212. djSet(fajlstana, "Vlasnik", "DRZAVA");
  213. djSetInt(fajlstana, "Na_Prodaju", 1);
  214. djSetInt(fajlstana, "Cena", Sell);
  215. djSetInt(fajlstana, "Rent", 10);
  216. djSetInt(fajlstana, "Level", lvl);
  217. djSetFloat(fajlstana,"X", X);
  218. djSetFloat(fajlstana,"Y", Y);
  219. djSetFloat(fajlstana,"Z", Z);
  220. djSetInt(fajlstana, "VW", sledeci+1);
  221. djSetInt(fajlstana, "Zakljucana", 0);
  222. djSetFloat(fajlstana, "IntXStana",2807.619873);
  223. djSetFloat(fajlstana, "IntYStana",-1171.899902);
  224. djSetFloat(fajlstana, "IntZStana",1025.570312);
  225. djSetInt(fajlstana, "IntIDStana",8);
  226. djAutocommit(true);
  227. UcitajStanove(sledeci);
  228. SendClientMessage(playerid, -1, " Stan napravljen!");
  229. }
  230.  
  231. }
  232. }
  233. return true;
  234. }
Add Comment
Please, Sign In to add comment