Advertisement
BlooDMasK

Untitled

Jul 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 20.22 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <YSI\y_ini>
  4. #include <YSI\y_hooks>
  5. #include "../include/gl_common.inc"
  6. #include <zcmd>
  7. #include <streamer>
  8.  
  9. #define SCM SendClientMessage
  10.  
  11. //DIALOGS
  12. #define DIALOG_REGISTER 1
  13. #define DIALOG_LOGIN 2
  14. #define DIALOG_SUCCESS1 3
  15. #define DIALOG_SUCCESS2 4
  16. #define DIALOG_ANNI 5
  17. #define DIALOG_SESSO 6
  18. #define DIALOG_GIRO 7
  19. #define DIALOG_REGOLAMENTO 8
  20. #define DIALOG_LAVORI 9
  21. #define DIALOG_REGOL 1998
  22. #define DIALOG_VENDIH 2017//droga
  23. #define DIALOG_COMPRAH 2018//droga
  24. //COLORI
  25. #define COL_TITLES "{FFEE00}"
  26. #define COL_BIANCO "{FFFFFF}"
  27. #define COL_ROSSO "{F81414}"
  28. #define COL_VERDE "{00FF22}"
  29. #define COL_AZZU "{D6D8FF}"
  30. #define COL_BLU "{0000C1}"
  31. #define COLORE_POLIZIA 0x00D9E6FF
  32. #define COLORE_MEDICI 0xFF0000FF
  33. #define BIANCO 0xFFFFFFFF
  34. #define NERO 0x000000FF
  35. #define VERDE 0x005700FF
  36. #define BLU 0x0000FFFF
  37. #define GIALLO 0xFFEE00FF
  38. #define GIALLOSCURO 0xFFB900FF
  39. #define ARANCIONE 0xFF6600FF
  40. #define GRIGIO 0xAFAFAFAA
  41. #define ROSSO 0xFF0000FF
  42. #define COLOR_FADE1 0xE6E6E6E6
  43. #define COLOR_FADE2 0xC8C8C8C8
  44. #define COLOR_FADE3 0xAAAAAAAA
  45. #define COLOR_FADE4 0x8C8C8C8C
  46. #define COLOR_FADE5 0x6E6E6E6E
  47. #define COLOR_GRAD1 0xB4B5B7FF
  48. #define COLOR_GRAD2 0xBFC0C2FF
  49. #define COLOR_GRAD3 0xCBCCCEFF
  50. #define COLOR_GRAD4 0xD8D8D8FF
  51. #define COLOR_GRAD5 0xE3E3E3FF
  52. #define COLOR_GRAD6 0xF0F0F0FF
  53. #define DVERDE 0x5DFF00FF
  54. //SISTEMA DROGA
  55. new d_lavorazione[MAX_PLAYERS] = 0;
  56. new Text3D:percentuale[MAX_PLAYERS];
  57. new Text3D:C_progresso[MAX_PLAYERS];
  58. new fumando[MAX_PLAYERS] = 0;
  59.  
  60. enum nInfo
  61. {
  62.         nPiantaF,
  63.         nPiantaI,
  64.         Float:nX,
  65.         Float:nY,
  66.         Float:nZ,
  67.         nVaso,
  68.         nPiantati,
  69.         nRaccoglibili
  70. }
  71. new SemiInfo[MAX_PLAYERS][nInfo];
  72.  
  73. enum pInfo
  74. {
  75.         pSoldi,
  76.         pSemini,//droga
  77.         pCanapa,//droga
  78.         pHashish,//droga
  79.         pAccendino,//droga
  80.         pCartine,//droga
  81. };
  82. new PlayerInfo[MAX_PLAYERS][pInfo];
  83. #if defined FILTERSCRIPT
  84.  
  85. public OnFilterScriptInit()
  86. {
  87.     print("\n--------------------------------------");
  88.     print(" Blank Filterscript by your name here");
  89.     print("--------------------------------------\n");
  90.     return 1;
  91. }
  92.  
  93. public OnFilterScriptExit()
  94. {
  95.     return 1;
  96. }
  97.  
  98. #else
  99.  
  100. main()
  101. {
  102.     print("\n----------------------------------");
  103.     print(" Blank Gamemode by your name here");
  104.     print("----------------------------------\n");
  105. }
  106.  
  107. #endif
  108.  
  109. public OnGameModeInit()
  110. {
  111.             //PICKUP SISTEMA DROGA
  112.         CreatePickup(1239, 1, -394.9466,-1438.5430,25.7266, 0);
  113.         Create3DTextLabel("Premi Y per comprare i semini\nPrezzo: x", GIALLO, -394.9466,-1438.5430,25.7266, 3.0, 0, 0);
  114.         return 1;
  115. }
  116.  
  117. /*CMD:dvendi(playerid, params[]){
  118.     new id;
  119.     SetPVarInt(playerid, "u", id);
  120.     if(sscanf(params, "u", id)){
  121.     new Float:X, FLoat:Y, Float:Z;
  122.     GetPlayerPos(GetPVarInt(playerid, "u"), X, Y, Z);
  123.     if(!IsPlayerInRangeOfPoint(playerid, 4.0, X, Y, Z)) return SCM(playerid, ROSSO, "Devi essere vicino al Player!");
  124.     ShowPlayerDialog(playerid, DIALOG_VENDIH, DIALOG_STYLE_INPUT, ""COL_TITLES"Vendi Droga","Inserisci i parametri seguendo l'ordine:\n[Prezzo (da 300$ a 500$)] [Grammi]\n Esempio: 350 2","Vendi","Annulla");
  125.     if(id == INVALID_PLAYER_ID) return ShowPlayerDialog(playerid, DIALOG_VENDIH, DIALOG_STYLE_INPUT, ""COL_TITLES"Vendi Droga",""COL_ROSSO"ID/NOME player invalido.\n "COL_AZZU"Reinserisci correttamente i parametri seguendo l'ordine:\n [Prezzo (da 300$ a 500$)] [Grammi]","Vendi","Annulla");
  126.     if(id == playerid) return ShowPlayerDialog(playerid, DIALOG_VENDIH, DIALOG_STYLE_INPUT, ""COL_TITLES"Vendi Droga",""COL_ROSSO"Non puoi venderti la droga!\n "COL_AZZU"Reinserisci correttamente i parametri seguendo l'ordine:\n [Prezzo (da 300$ a 500$)] [Grammi]","Vendi","Annulla");
  127.     SetPVarInt(playerid, "id", id);
  128.     }else{ SCM(playerid, ROSSO, "Utilizzo:/dvendi [ID]");}
  129.     return 1;}*/
  130.  
  131. CMD:lavoracanapa(playerid, params[]){
  132. new Float:X, Float:Y, Float:Z;
  133. if(PlayerInfo[playerid][pCanapa] == 0) return SCM(playerid, ROSSO, "Devi prima produrre della Canapa!");
  134. if(PlayerInfo[playerid][pHashish] == 20) return SCM(playerid, ROSSO, "Possiedi già 20g di Hashish!");
  135. if(d_lavorazione[playerid] == 1) return SCM(playerid, ROSSO, "Stai già lavorando della canapa, attendi.");
  136. SCM(playerid, ARANCIONE, "Attendi 1 minuto...");
  137. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  138. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  139. PlayerInfo[playerid][pCanapa]--;
  140. GetPlayerPos(playerid, X, Y, Z);
  141. C_progresso[playerid] = Create3DTextLabel("0%\n Lavorazione in corso...", GIALLO, X, Y, Z, 4.0, 0, 0);
  142. d_lavorazione[playerid] = 1;
  143. SetTimerEx("C_Progresso1", 3000, false, "i", playerid);
  144. return 1;}
  145.  
  146. forward C_Progresso1(playerid);
  147. public C_Progresso1(playerid){
  148. Update3DTextLabelText(C_progresso[playerid], GIALLO, "10%\nLavorazione in corso...");
  149. SetTimerEx("C_Progresso2", 3000, false, "i", playerid);}
  150.  
  151. forward C_Progresso2(playerid);
  152. public C_Progresso2(playerid){
  153. Update3DTextLabelText(C_progresso[playerid], GIALLO, "20%\nLavorazione in corso...");
  154. SetTimerEx("C_Progresso3", 3000, false, "i", playerid);}
  155.  
  156. forward C_Progresso3(playerid);
  157. public C_Progresso3(playerid){
  158. Update3DTextLabelText(C_progresso[playerid], GIALLO, "30%\nLavorazione in corso...");
  159. SetTimerEx("C_Progresso4", 3000, false, "i", playerid);}
  160.  
  161. forward C_Progresso4(playerid);
  162. public C_Progresso4(playerid){
  163. Update3DTextLabelText(C_progresso[playerid], GIALLO, "40%\nLavorazione in corso...");
  164. SetTimerEx("C_Progresso5", 3000, false, "i", playerid);}
  165.  
  166. forward C_Progresso5(playerid);
  167. public C_Progresso5(playerid){
  168. Update3DTextLabelText(C_progresso[playerid], GIALLO, "50%\nLavorazione in corso...");
  169. SetTimerEx("C_Progresso6", 3000, false, "i", playerid);}
  170.  
  171. forward C_Progresso6(playerid);
  172. public C_Progresso6(playerid){
  173. Update3DTextLabelText(C_progresso[playerid], GIALLO, "60%\nLavorazione in corso...");
  174. SetTimerEx("C_Progresso7", 3000, false, "i", playerid);}
  175.  
  176. forward C_Progresso7(playerid);
  177. public C_Progresso7(playerid){
  178. Update3DTextLabelText(C_progresso[playerid], GIALLO, "70%\nLavorazione in corso...");
  179. SetTimerEx("C_Progresso8", 3000, false, "i", playerid);}
  180.  
  181. forward C_Progresso8(playerid);
  182. public C_Progresso8(playerid){
  183. Update3DTextLabelText(C_progresso[playerid], GIALLO, "80%\nLavorazione in corso...");
  184. SetTimerEx("C_Progresso9", 3000, false, "i", playerid);}
  185.  
  186. forward C_Progresso9(playerid);
  187. public C_Progresso9(playerid){
  188. Update3DTextLabelText(C_progresso[playerid], GIALLO, "90%\nLavorazione in corso...");
  189. SetTimerEx("C_Progresso10", 3000, false, "i", playerid);}
  190.  
  191. forward C_Progresso10(playerid);
  192. public C_Progresso10(playerid){
  193. Update3DTextLabelText(C_progresso[playerid], GIALLO, "100%\nLavorazione in corso...");
  194. SetTimerEx("C_Progresso11", 2000, false, "i", playerid);}
  195.  
  196. forward C_Progresso11(playerid);
  197. public C_Progresso11(playerid){
  198. PlayerInfo[playerid][pHashish]= PlayerInfo[playerid][pHashish] + 20;//20g
  199. ClearAnimations(playerid);
  200. SCM(playerid, GIALLO, "Hai prodotto 20g di Hashish!");
  201. Delete3DTextLabel(C_progresso[playerid]);}
  202.  
  203.  
  204.  
  205.  
  206. CMD:pianta(playerid, params[]){
  207. if(PlayerInfo[playerid][pCanapa] == 6) return SCM(playerid, ROSSO, "Possiedi già 6 ettogrammi di Canapa!");
  208. if(PlayerInfo[playerid][pSemini] <= 4) return SCM(playerid, ROSSO, "Ti servono prima 5 semini!");
  209. if(PlayerInfo[playerid][pHashish] == 20) return SCM(playerid, ROSSO, "Possiedi già 20g di Hashish!");
  210. if(SemiInfo[playerid][nPiantati] == 1) return SCM(playerid, ROSSO, "Sono stati già piantati 5 semini, attendi il completamento!");
  211. //--------//
  212. PlayerInfo[playerid][pSemini]= PlayerInfo[playerid][pSemini] - 5;
  213. SemiInfo[playerid][nPiantati] = 1;
  214. SetTimerEx("AnimazionePianta", 1000, false, "i", playerid);
  215. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  216. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  217. return 1;}
  218.  
  219. forward AnimazionePianta(playerid);
  220. public AnimazionePianta(playerid){
  221. ClearAnimations(playerid);
  222. GetPlayerPos(playerid, SemiInfo[playerid][nX], SemiInfo[playerid][nY], SemiInfo[playerid][nZ]);
  223. //SemiInfo[playerid][nPiantaF] = CreateObject(19473, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.6119, 0.0, 0.0, 0.0, 0);
  224. SemiInfo[playerid][nVaso] = CreateObject(2203, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-0.8196, 0.0, 0.0, 0.0, 0);
  225. percentuale[playerid] = Create3DTextLabel("0%", GIALLO, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.600, SemiInfo[playerid][nZ]-0.8196, 4.0, 0, 0);
  226. SetTimerEx("Pianta1", 50000, false, "i", playerid);}
  227. //----INIZIO CRESCITA PIANTINA----//
  228. forward Pianta1(playerid);
  229. public Pianta1(playerid){
  230. SemiInfo[playerid][nPiantaI] = CreateObject(862, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.5719, 0.0, 0.0, 0.0, 0);
  231. Update3DTextLabelText(percentuale[playerid], GIALLO, "10%");
  232. SetTimerEx("Pianta2", 50000, false, "i", playerid);}
  233.  
  234. forward Pianta2(playerid);
  235. public Pianta2(playerid){
  236. MoveObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.3319, 0.005);//1
  237. Update3DTextLabelText(percentuale[playerid], GIALLO, "20%");
  238. SetTimerEx("Pianta3", 50000, false, "i", playerid);}
  239.  
  240. forward Pianta3(playerid);
  241. public Pianta3(playerid){
  242. MoveObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.1, 0.005);//2
  243. Update3DTextLabelText(percentuale[playerid], GIALLO, "30%");
  244. SetTimerEx("Pianta4", 50000, false, "i", playerid);}
  245.  
  246. forward Pianta4(playerid);
  247. public Pianta4(playerid){
  248. MoveObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.0, 0.005);//3
  249. Update3DTextLabelText(percentuale[playerid], GIALLO, "40%");
  250. SetTimerEx("Pianta5", 50000, false, "i", playerid);}
  251.  
  252. forward Pianta5(playerid);
  253. public Pianta5(playerid){
  254. MoveObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-1.7719, 0.009);//4
  255. Update3DTextLabelText(percentuale[playerid], GIALLO, "50%");
  256. SetTimerEx("Pianta6", 50000, false, "i", playerid);}
  257. //----FINE CRESCITA PIANTINA----//
  258. //----INIZIO CRESCITA CANAPA----//
  259. forward Pianta6(playerid);
  260. public Pianta6(playerid){
  261. DestroyObject(SemiInfo[playerid][nPiantaI]);
  262. SemiInfo[playerid][nPiantaF] = CreateObject(19473, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-0.7800, 0.0, 0.0, 0.0, 0);
  263. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFFE9FF00 );
  264. Update3DTextLabelText(percentuale[playerid], GIALLO, "60%");
  265. SetTimerEx("Pianta7", 50000, false, "i", playerid);}
  266.  
  267. forward Pianta7(playerid);
  268. public Pianta7(playerid){
  269. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFFCCFF00);
  270. Update3DTextLabelText(percentuale[playerid], GIALLO, "70%");
  271. SetTimerEx("Pianta8", 50000, false, "i", playerid);}
  272.  
  273. forward Pianta8(playerid);
  274. public Pianta8(playerid){
  275. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFFB6FF00);
  276. Update3DTextLabelText(percentuale[playerid], GIALLO, "80%");
  277. //SemiInfo[playerid][nRaccoglibili] = 1;
  278. SetTimerEx("Pianta9", 50000, false, "i", playerid);}
  279.  
  280. forward Pianta9(playerid);
  281. public Pianta9(playerid){
  282. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF4CFF00);
  283. Update3DTextLabelText(percentuale[playerid], GIALLO, "90%");
  284. SetTimerEx("Pianta10", 50000, false, "i", playerid);}
  285.  
  286. forward Pianta10(playerid);
  287. public Pianta10(playerid){
  288. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF33AA00);
  289. Update3DTextLabelText(percentuale[playerid], GIALLO, "100%");
  290. SetTimerEx("Pianta11", 50000, false, "i", playerid);}
  291. //----FINE CRESCITA CANAPA-----------------------------------------------------------------------------------------
  292. //----INIZIO SECC.----//
  293. forward Pianta11(playerid);
  294. public Pianta11(playerid){
  295. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF666600);
  296. Update3DTextLabelText(percentuale[playerid], ROSSO, "Attenzione, la pianta inizia a seccare! (2 min.)\n 0%");
  297. SetTimerEx("Pianta12", 20000, false, "i", playerid);}
  298.  
  299. forward Pianta12(playerid);
  300. public Pianta12(playerid){
  301. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF876500);
  302. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(1 min. 40 sec.)\n 20%");
  303. SemiInfo[playerid][nRaccoglibili] = 3;//<----------------------
  304. SetTimerEx("Pianta13", 20000, false, "i", playerid);}
  305.  
  306. forward Pianta13(playerid);
  307. public Pianta13(playerid){
  308. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF664C00);
  309. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(1 min. 20 sec.)\n 40%)");
  310. SemiInfo[playerid][nRaccoglibili] = 2;//<----------------------
  311. SetTimerEx("Pianta14", 20000, false, "i", playerid);}
  312.  
  313. forward Pianta14(playerid);
  314. public Pianta14(playerid){
  315. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF543900);
  316. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(1 min.)\n 60%");
  317. SemiInfo[playerid][nRaccoglibili] = 2;//<----------------------
  318. SetTimerEx("Pianta15", 20000, false, "i", playerid);}
  319.  
  320. forward Pianta15(playerid);
  321. public Pianta15(playerid){
  322. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF442F02);
  323. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(40 sec.)\n 80%");
  324. SemiInfo[playerid][nRaccoglibili] = 1;//<----------------------
  325. SetTimerEx("Pianta16", 20000, false, "i", playerid);}
  326.  
  327. forward Pianta16(playerid);
  328. public Pianta16(playerid){
  329. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF382600);
  330. Update3DTextLabelText(percentuale[playerid], ROSSO, "Attenzione, la pianta è quasi completamente seccata!\n Non puoi più raccogliere.(20 sec.)\n 100%");
  331. SemiInfo[playerid][nRaccoglibili] = 0;//<----------------------
  332. SetTimerEx("Pianta17", 20000, false, "i", playerid);}
  333. //----FINE SECC.----//
  334. forward Pianta17(playerid);
  335. public Pianta17(playerid){
  336. DestroyObject(SemiInfo[playerid][nPiantaF]);
  337. SetTimerEx("DistruggiVaso", 2000, false, "i", playerid);
  338. Delete3DTextLabel(percentuale[playerid]);}
  339.  
  340. forward DistruggiVaso(playerid);
  341. public DistruggiVaso(playerid){
  342. SemiInfo[playerid][nPiantati] = 0;
  343. DestroyObject(SemiInfo[playerid][nVaso]);}
  344.  
  345. //3 minuti 180000 + 30 secondi 30000 = 210000 diviso 10 timer = 21000 tick (21 secondi)
  346.  
  347. CMD:draccogli(playerid, params[]){
  348. if(PlayerInfo[playerid][pHashish] == 20) return SCM(playerid, ROSSO, "Possiedi già 20g di Hashish!");
  349. if(PlayerInfo[playerid][pCanapa] == 6) return SCM(playerid, ROSSO, "Possiedi già 6 ettogrammi di Canapa!");
  350. if(!IsPlayerInRangeOfPoint(playerid, 1.5, SemiInfo[playerid][nX], SemiInfo[playerid][nY], SemiInfo[playerid][nZ])){
  351. SCM(playerid, ROSSO, "Devi essere vicino ad una piantina raccoglibile!");}else{
  352. if(SemiInfo[playerid][nPiantati] == 1){
  353. if(SemiInfo[playerid][nRaccoglibili] == 0) return SCM(playerid, ROSSO, "Ancora non puoi raccogliere, attendi!");}
  354. //------------------------------------------//
  355. if(SemiInfo[playerid][nPiantati] == 1){
  356. if(SemiInfo[playerid][nRaccoglibili] == 1){
  357. PlayerInfo[playerid][pCanapa]++;}
  358. else if(SemiInfo[playerid][nRaccoglibili] == 2){
  359. PlayerInfo[playerid][pCanapa]++;
  360. PlayerInfo[playerid][pCanapa]++;}
  361. else if(SemiInfo[playerid][nRaccoglibili] == 3){
  362. PlayerInfo[playerid][pCanapa]++;
  363. PlayerInfo[playerid][pCanapa]++;
  364. PlayerInfo[playerid][pCanapa]++;}}
  365. SemiInfo[playerid][nRaccoglibili] = 0;
  366. SemiInfo[playerid][nPiantati] = 0;
  367. SetTimerEx("AnimazioneRaccogli", 2500, false, "i", playerid);
  368. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  369. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);}
  370. return 1;}
  371.  
  372. forward AnimazioneRaccogli(playerid);
  373. public AnimazioneRaccogli(playerid){
  374. ClearAnimations(playerid);
  375. DestroyObject(SemiInfo[playerid][nPiantaF]);
  376. Delete3DTextLabel(percentuale[playerid]);
  377. SetTimerEx("DistruzioneVaso", 2000, false, "i", playerid);}
  378.  
  379. forward DistruzioneVaso(playerid);
  380. public DistruzioneVaso(playerid){
  381. DestroyObject(SemiInfo[playerid][nVaso]);}
  382.  
  383. CMD:usadroga(playerid, params[]){
  384. new stringg[500];
  385. if(PlayerInfo[playerid][pHashish] == 0) return SCM(playerid, ROSSO, "Devi prima acquistare/produrre hashish!");
  386. if(PlayerInfo[playerid][pCartine] == 0) return SCM(playerid, ROSSO, "Devi comprare una cartina lunga!");
  387. if(PlayerInfo[playerid][pAccendino] == 0) return SCM(playerid, ROSSO, "Non possiedi un accendino!");
  388. if(!IsPlayerInAnyVehicle(playerid)){
  389. if(maschera[playerid] == 0){
  390. format(stringg, sizeof(string), "* %s inizia a sciogliere l'Hashish con un accendino per poi rollarlo nella cartina lunga insieme a del tabacco. *", RemoveUnderScore(playerid));
  391. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}
  392. else if(maschera[playerid] == 1){
  393. format(string, sizeof(string), "* Uomo Mascherato[ID:%d] inizia a sciogliere l'Hashish con un accendino per poi rollarlo nella cartina lunga. *", playerid);
  394. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}}
  395.  
  396. if(IsPlayerInAnyVehicle(playerid)){
  397. if(maschera[playerid] == 0){
  398. format(string, sizeof(string), "* %s inizia a sciogliere l'Hashish con un accendino per poi rollarlo nella cartina lunga insieme a del tabacco. *", RemoveUnderScore(playerid));
  399. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}
  400. else if(maschera[playerid] == 1){
  401. format(string, sizeof(string), "* Uomo Mascherato[ID:%d] inizia a sciogliere l'Hashish con un accendino per poi rollarlo nella cartina lunga. *", playerid);
  402. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}}
  403. SCM(playerid, GIALLO, "Attendi 10 secondi...");
  404. SetTimerEx("Rolla", 10000, false, "i", playerid);
  405. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  406. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  407. PlayerInfo[playerid][pHashish]--;
  408. PlayerInfo[playerid][pCartine]--;
  409. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
  410. fumando[playerid] = 1;
  411. SetTimerEx("FineH", 240000, false, "i", playerid);
  412. return 1;}
  413.  
  414. forward Rolla(playerid);
  415. public Rolla(playerid){
  416. ClearAnimations(playerid);}
  417.  
  418.  
  419. forward FineH(playerid);
  420. public FineH(playerid){
  421. fumando[playerid] = 0;
  422. ClearAnimations(playerid);}
  423.  
  424. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  425. {
  426.         if(newkeys & KEY_YES && IsPlayerInRangeOfPoint(playerid, 1.0, -394.9466,-1438.5430,25.7266)){//semini
  427.         if(PlayerInfo[playerid][pSemini] == 10) return SCM(playerid, ROSSO, "Possiedi già 10 semini nell'inventario!");
  428.         else{
  429.         new string1[128];
  430.         PlayerInfo[playerid][pSemini]++;
  431.         format(string1, sizeof(string1), "Hai un numero di semini pari a %d",PlayerInfo[playerid][pSemini]);
  432.         SCM(playerid, GIALLO, string1);}
  433.         return 1;
  434. }
  435.  
  436. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  437. {
  438.     if(dialogid == DIALOG_VENDIH){
  439.     if(response)
  440.     new prezzo, grammi, string[500];
  441.     if(sscanf(inputtext, "dd", prezzo, grammi))
  442.     if(prezzo < 300 || prezzo > 500) return ShowPlayerDialog(playerid, DIALOG_VENDIH, DIALOG_STYLE_INPUT, ""COL_TITLES"Vendi Droga",""COL_ROSSO"Il prezzo deve essere compreso tra i 300$ e i 500$!\n "COL_AZZU"Reinserisci correttamente i parametri seguendo l'ordine:\n [Prezzo] [Grammi]","Vendi","Annulla");
  443.     if(PlayerInfo[playerid][pHashish] < grammi) return ShowPlayerDialog(playerid, DIALOG_VENDIH, DIALOG_STYLE_INPUT, ""COL_TITLES"Vendi Droga",""COL_ROSSO"Non possiedi tutti questi grammi!\n "COL_AZZU"Reinserisci correttamente i parametri seguendo l'ordine:\n [Prezzo] [Grammi]","Vendi","Annulla");
  444.     format(string(sizeof(string), "%s vuole venderti %d g di Hashish a %d $.\n Vuoi acquistare?", playerid, grammi, prezzo));
  445.     ShowPlayerDialog(GetPVarInt(playerid, "id"), DIALOG_COMPRAH, DIALOG_STYLE_MSGBOX, ""COL_TITLES"Compra Droga", string, "Compra", "Rifiuta");
  446.     SCM(playerid, GIALLO, "In attesa di una risposta...");}
  447.     return 1;
  448. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement