Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.65 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4. #include <a_samp>
  5. #include <zcmd>
  6. #include <YSI\y_ini>
  7. #include <YSI\y_iterate>
  8. #include <YSI\y_timers>
  9. #include <sscanf2>
  10. #include <streamer>
  11.  
  12. #define MAX_SADNICA 150
  13.  
  14. enum pInfo
  15. {
  16. pSeme,
  17. pNeobradjena,
  18. pDroga
  19. }
  20. new PlayerInfo[MAX_PLAYERS][pInfo];
  21.  
  22. enum MarInfo
  23. {
  24. mMarihuanaObjekatID,
  25. Text3D:mMarihuanaLabel,
  26. bool:mPosadjena,
  27. mMinutaPosadjeno,
  28. bool:mSpremnaBranje,
  29. mGrama,
  30. Float:mPozX,
  31. Float:mPozY,
  32. Float:mPozZ
  33. };
  34. new MarihuanaInfo[MAX_SADNICA][MarInfo];
  35.  
  36. public OnFilterScriptInit()
  37. {
  38. print("\n--------------------------------------");
  39. print(" Blank Filterscript by your name here");
  40. print("--------------------------------------\n");
  41. return 1;
  42. }
  43.  
  44. main()
  45. {
  46. print("\n----------------------------------");
  47. print(" Blank Gamemode by your name here");
  48. print("----------------------------------\n");
  49. }
  50.  
  51. public OnGameModeInit()
  52. {
  53. // Don't use these lines if it's a filterscript
  54. SetGameModeText("Blank Script");
  55. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  56.  
  57.  
  58. Create3DTextLabel("/kupiseme", -1, 1951.9841,1343.0011,15.3746, 40.0, 0, 0); //2355.7651, -647.1533, 128.0547 koordinate za balkanium
  59. Create3DTextLabel("Polje(1)", -1, 1963.2262,1374.5845,9.2578, 40.0, 0, 0); //887.5068, -19.3465, 63.3301 koordinate za balkanium
  60. Create3DTextLabel("Polje(2)", -1, 893.0886, -22.1127, 63.2500, 40.0, 0, 0);
  61. Create3DTextLabel("Polje(3)", -1, 890.8806, -28.0678, 63.2981, 40.0, 0, 0);
  62. Create3DTextLabel("Polje(4)", -1, 885.1781, -26.0521, 63.2499, 40.0, 0, 0);
  63.  
  64. SetTimer("porukaha", 5000, false);
  65.  
  66. return 1;
  67. }
  68. stock g_Marihuana_Posadi(playerid, Float:Poz_X, Float:Poz_Y, Float:Poz_Z)
  69. {
  70. new mar_id;
  71. if(mar_id == -1)
  72. {
  73. SendClientMessage(-1, playerid, "{ff0000}.:LW:AC:.{FFFFFF} Dogodila se greska sa kreiranem sadnice u stocku, PRIJAVITE OVO HEAD ADMINU!");
  74. return -1;
  75. }
  76. MarihuanaInfo[mar_id][mPozX] = Poz_X;
  77. MarihuanaInfo[mar_id][mPozY] = Poz_Y;
  78. MarihuanaInfo[mar_id][mPozZ] = Poz_Z-2;
  79. MarihuanaInfo[mar_id][mGrama] = 0;
  80. MarihuanaInfo[mar_id][mPosadjena] = true;
  81. MarihuanaInfo[mar_id][mMinutaPosadjeno] = 0;
  82. MarihuanaInfo[mar_id][mSpremnaBranje] = false;
  83. MarihuanaInfo[mar_id][mMarihuanaObjekatID] = CreateDynamicObject(3409,1963.2262, 1374.5845, 9.2578, 0.0, 0.0, 96, 0, -1, -1, 200.0);
  84. MarihuanaInfo[mar_id][mMarihuanaLabel] = CreateDynamic3DTextLabel("Marihuana\nNije spremna za branje\nKoristite tipku 'Y' za branje/unistvanje", 0x1D9F00AA, MarihuanaInfo[mar_id][mPozX], MarihuanaInfo[mar_id][mPozY], MarihuanaInfo[mar_id][mPozZ]+1.0, 10.0,_,_,_, 0, 0,_,_);
  85. PlayerPlaySound(playerid,2000,0,0,0);
  86. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 0, 0, 0, 0, 0, 1);
  87. new string[70];
  88. new GetName[MAX_PLAYER_NAME];
  89. format(string, sizeof(string), "* %s uzima semenke marihuane i sadi ih.", GetName);
  90. SendClientMessage(playerid, -1, string);
  91. SendClientMessage(playerid, -1, "Posadili ste marihuane i mozete je ubrati za 15 minuta!");
  92. SendClientMessage(playerid, -1, "BlaBlaBla!");
  93. return mar_id;
  94. }
  95. stock g_Marihuana_Unisti(mar_id)
  96. {
  97. DestroyDynamicObject(MarihuanaInfo[mar_id][mMarihuanaObjekatID]);
  98. DestroyDynamic3DTextLabel(MarihuanaInfo[mar_id][mMarihuanaLabel]);
  99. MarihuanaInfo[mar_id][mPozX] = 0;
  100. MarihuanaInfo[mar_id][mPozY] = 0;
  101. MarihuanaInfo[mar_id][mPozZ] = 0;
  102. MarihuanaInfo[mar_id][mGrama] = 0;
  103. MarihuanaInfo[mar_id][mMinutaPosadjeno] = 0;
  104. MarihuanaInfo[mar_id][mSpremnaBranje] = false;
  105. MarihuanaInfo[mar_id][mPosadjena] = false;
  106. return 1;
  107. }
  108.  
  109.  
  110. CMD:kupiseme(playerid, params[])
  111. {
  112. if(IsPlayerInRangeOfPoint(playerid, 2.0, 1951.9841,1343.0011,15.3746))
  113. {
  114. new kolicina=0, str[64], strr[64];
  115.  
  116. if(sscanf(params, "i", kolicina)) return SendClientMessage(playerid, -1, "/kupiseme [kolicina]");
  117.  
  118. else
  119. {
  120. PlayerInfo[playerid][pSeme] += kolicina;
  121. format(str, sizeof(str), "Uzeli ste %d kolicine", kolicina);
  122. SendClientMessage(playerid, -1, str);
  123. format(strr, sizeof(strr), "Imate %d semena", PlayerInfo[pSeme]);
  124. SendClientMessage(playerid, -1, strr);
  125. }
  126. }
  127. else
  128. {
  129. SendClientMessage(playerid, -1, "Nisi na pravom mestu");
  130. }
  131.  
  132. return 1;
  133. }
  134. CMD:droga(playerid, params[])
  135. {
  136. new droga[64];
  137. format(droga, sizeof(droga), "Imate %d semena", PlayerInfo[pSeme]);
  138. SendClientMessage(playerid, -1, droga);
  139. return 1;
  140. }
  141. CMD:sadidrogu(playerid, params[])
  142. {
  143. new Float:x, Float:y, Float:z;
  144. if(IsPlayerInRangeOfPoint(playerid, 2.0, 1963.2262,1374.5845,9.2578))
  145. {
  146. if(PlayerInfo[playerid][pSeme] == 0) return SendClientMessage(playerid, -1, "Nemate seme za sadjenje");
  147. GetPlayerPos(playerid, x, y, z);
  148. g_Marihuana_Posadi(playerid, x, y, z);
  149. PlayerInfo[playerid][pSeme] --;
  150. }
  151. else
  152. {
  153. SendClientMessage(playerid, -1, "Nista na polju");
  154. }
  155. return 1;
  156. }
  157. CMD:uzmidrogu(playerid, params[])
  158. {
  159. if(IsPlayerInRangeOfPoint(playerid, 2.0, 1963.2262,1374.5845,9.2578))
  160. {
  161. }
  162. else
  163. {
  164. SendClientMessage(playerid, -1, "Nista na polju");
  165. }
  166. return 1;
  167. }
  168. CMD:obradidrogu(playerid, params[])
  169. {
  170. return 1;
  171. }
  172. CMD:usedugs(playerid, params[])
  173. {
  174. return 1;
  175. }
  176. public OnPlayerRequestClass(playerid, classid)
  177. {
  178. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  179. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  180. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  181. return 1;
  182. }
  183. public porukaha()
  184. {
  185. new mar_id;
  186. MarihuanaInfo[mar_id][mMinutaPosadjeno] ++;
  187. }
  188. forward porukaha();
  189.  
  190. #define PRESSED(%0) \
  191. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  192. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  193. {
  194. if(PRESSED(KEY_YES))
  195. {
  196. new string[80], mar_id;
  197.  
  198. if(IsPlayerInRangeOfPoint(playerid, 3.0, 1963.2262, 1374.5845, 9.2578))
  199. {
  200. //if(PlayerInfo[mMinutaPosadjeno])
  201. if(MarihuanaInfo[mar_id][mMinutaPosadjeno] == 5)
  202. {
  203. new Name[MAX_PLAYER_NAME];
  204. format(string, sizeof(string), "* %s se saginje i bere marihuanu.", Name);
  205. format(string, sizeof(string), "Ubrali ste %d grama marihuane.", MarihuanaInfo[mar_id][mGrama]);
  206. SendClientMessage(playerid, -1, string);
  207. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 6.0, 0, 0, 0, 0, 0, 1);
  208. new marihuana_sledeca;
  209. PlayerInfo[playerid][pNeobradjena] += 50;
  210. g_Marihuana_Unisti(mar_id);
  211. mar_id = marihuana_sledeca;
  212. }
  213. if(MarihuanaInfo[mar_id][mMinutaPosadjeno] != 0)
  214. {
  215. SendClientMessage(playerid, -1, "Nije jos vreme");
  216. }
  217. }
  218. else
  219. {
  220. SendClientMessage(playerid, -1, "Niste na pravom mestu");
  221. }
  222. }
  223. return 1;
  224. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement