Guest User

Untitled

a guest
May 21st, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.05 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, "225.756989",2260.76);
  36. djSetFloat(fajlVikendice, "1240.000000",-1210.45);
  37. djSetFloat(fajlVikendice, "1082.149902",1049.02);
  38. djSetInt(fajlVikendice, "2",10);
  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, "328.493988",2260.76);
  58. djSetFloat(fajlVikendice, "1480.589966",-1210.45);
  59. djSetFloat(fajlVikendice, "1084.449951",1049.02);
  60. djSetInt(fajlVikendice, "15",10);
  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, "223.043991",2260.76);
  80. djSetFloat(fajlVikendice, "1289.259888",-1210.45);
  81. djSetFloat(fajlVikendice, "1082.199951",1049.02);
  82. djSetInt(fajlVikendice, "1",10);
  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, "385.803986",2260.76);
  102. djSetFloat(fajlVikendice, "1471.769897",-1210.45);
  103. djSetFloat(fajlVikendice, "1080.209961",1049.02);
  104. djSetInt(fajlVikendice, "15",10);
  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.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. YCMD:kreirajstan(playerid,params[], help)
  126. {
  127. #pragma unused params
  128. #pragma unused help
  129. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Samo admini!");
  130. new Sell, lvl, vrsta;
  131. if(sscanf(params, "iii", Sell, lvl , vrsta))
  132. {
  133. SendClientMessage(playerid, -1, "[USAGE]: /kreirajstan [cena] [lvl] [vrsta]");
  134. return true;
  135. }
  136. if(Sell < 5000 || Sell > 50000) return SendClientMessage(playerid, -1, "Cena izmedju 5k i 50k!");
  137. if(lvl < 2 || lvl > 12) return SendClientMessage(playerid, -1, "Level izmedju 2 i 12!");
  138. if((NekoristeniIDStana()-1) >= Max_Stanova) return SendClientMessage(playerid, -1, ""zuta" Stan:"zelena" Max stanova postoji.");
  139. new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
  140. new sledeci = NekoristeniIDStana();
  141. format(fajlstana, sizeof(fajlstana), "/Stanovi/%d.json", sledeci);
  142. if(!fexist(fajlstana))
  143. {
  144. switch(vrsta)
  145. {
  146. case 1: // Small/1 story/1 bedroom
  147. {
  148. djCreateFile(fajlstana);
  149. djSet(fajlstana, "Vlasnik", "DRZAVA");
  150. djSetInt(fajlstana, "Na_Prodaju", 1);
  151. djSetInt(fajlstana, "Cena", Sell);
  152. djSetInt(fajlstana, "Rent", 10);
  153. djSetInt(fajlstana, "Level", lvl);
  154. djSetFloat(fajlstana,"X", X);
  155. djSetFloat(fajlstana,"Y", Y);
  156. djSetFloat(fajlstana,"Z", Z);
  157. djSetInt(fajlstana, "VW", sledeci+1);
  158. djSetInt(fajlstana, "Zakljucana", 0);
  159. djSetFloat(fajlstana, "1523.509887",2260.76);
  160. djSetFloat(fajlstana, "-47.821197",-1210.45);
  161. djSetFloat(fajlstana, "1002.130981",1049.02);
  162. djSetInt(fajlstana, "2",10);
  163. djAutocommit(true);
  164. UcitajStanove(sledeci);
  165. SendClientMessage(playerid, -1, " Stan napravljen!");
  166. }
  167.  
  168.  
  169.  
  170. case 2: // Small/1 story/1 bedroom
  171. {
  172. djCreateFile(fajlstana);
  173. djSet(fajlstana, "Vlasnik", "DRZAVA");
  174. djSetInt(fajlstana, "Na_Prodaju", 1);
  175. djSetInt(fajlstana, "Cena", Sell);
  176. djSetInt(fajlstana, "Rent", 10);
  177. djSetInt(fajlstana, "Level", lvl);
  178. djSetFloat(fajlstana,"X", X);
  179. djSetFloat(fajlstana,"Y", Y);
  180. djSetFloat(fajlstana,"Z", Z);
  181. djSetInt(fajlstana, "VW", sledeci+1);
  182. djSetInt(fajlstana, "Zakljucana", 0);
  183. djSetFloat(fajlstana, "1527.229980",2260.76);
  184. djSetFloat(fajlstana, "-11.574499",-1210.45);
  185. djSetFloat(fajlstana, "1002.097106",1049.02);
  186. djSetInt(fajlstana, "3",10);
  187. djAutocommit(true);
  188. UcitajStanove(sledeci);
  189. SendClientMessage(playerid, -1, " Stan napravljen!");
  190. }
  191.  
  192.  
  193. case 3: // Small/1 story/1 bedroom
  194. {
  195. djCreateFile(fajlstana);
  196. djSet(fajlstana, "Vlasnik", "DRZAVA");
  197. djSetInt(fajlstana, "Na_Prodaju", 1);
  198. djSetInt(fajlstana, "Cena", Sell);
  199. djSetInt(fajlstana, "Rent", 10);
  200. djSetInt(fajlstana, "Level", lvl);
  201. djSetFloat(fajlstana,"X", X);
  202. djSetFloat(fajlstana,"Y", Y);
  203. djSetFloat(fajlstana,"Z", Z);
  204. djSetInt(fajlstana, "VW", sledeci+1);
  205. djSetInt(fajlstana, "Zakljucana", 0);
  206. djSetFloat(fajlstana, "271.884979",2260.76);
  207. djSetFloat(fajlstana, "306.631988",-1210.45);
  208. djSetFloat(fajlstana, "999.148437",1049.02);
  209. djSetInt(fajlstana, "2",10);
  210. djAutocommit(true);
  211. UcitajStanove(sledeci);
  212. SendClientMessage(playerid, -1, " Stan napravljen!");
  213. }
  214.  
  215.  
  216. case 4: // Small/1 story/1 bedroom
  217. {
  218. djCreateFile(fajlstana);
  219. djSet(fajlstana, "Vlasnik", "DRZAVA");
  220. djSetInt(fajlstana, "Na_Prodaju", 1);
  221. djSetInt(fajlstana, "Cena", Sell);
  222. djSetInt(fajlstana, "Rent", 10);
  223. djSetInt(fajlstana, "Level", lvl);
  224. djSetFloat(fajlstana,"X", X);
  225. djSetFloat(fajlstana,"Y", Y);
  226. djSetFloat(fajlstana,"Z", Z);
  227. djSetInt(fajlstana, "VW", sledeci+1);
  228. djSetInt(fajlstana, "Zakljucana", 0);
  229. djSetFloat(fajlstana, "2807.619873",2260.76);
  230. djSetFloat(fajlstana, "-1171.899902",-1210.45);
  231. djSetFloat(fajlstana, "1025.570312",1049.02);
  232. djSetInt(fajlstana, "8",10);
  233. djAutocommit(true);
  234. UcitajStanove(sledeci);
  235. SendClientMessage(playerid, -1, " Stan napravljen!");
  236. }
  237.  
  238. }
  239. }
  240. return true;
  241. }
Add Comment
Please, Sign In to add comment