Advertisement
BlooDMasK

Untitled

Jul 31st, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 30.21 KB | None | 0 0
  1. //COMANDO RAPINA
  2. //31 CREATEOBJECT
  3. // 52 DIALOGS
  4. // SLOT ATTACHED 6
  5. // SLOT 0 == MANETTE
  6. // SLOT 1 == TAZER
  7. // SLOT 2 == CAPPELLO POLIZIA
  8. // SLOT 3 == ARMATURA
  9. // SLOT 4 == MASCHERA
  10. // SLOT 5 == ARMA
  11. #include <a_samp>
  12. #include <sscanf2>
  13. #include <YSI\y_ini>
  14. #include <YSI\y_hooks>
  15. #include "../include/gl_common.inc"
  16. #include <zcmd>
  17. #include <foreach>
  18. #include <streamer>
  19.  
  20. #define SCM SendClientMessage
  21.  
  22. //DIALOGS
  23. #define DIALOG_REGISTER 1
  24. #define DIALOG_LOGIN 2
  25. #define DIALOG_SUCCESS1 3
  26. #define DIALOG_SUCCESS2 4
  27. #define DIALOG_ANNI 5
  28. #define DIALOG_SESSO 6
  29. #define DIALOG_GIRO 7
  30. #define DIALOG_REGOLAMENTO 8
  31. #define DIALOG_LAVORI 9
  32. #define DIALOG_REGOL 1998
  33. #define DIALOG_VENDIH 2017//droga
  34. #define DIALOG_COMPRAH 2018//droga
  35. //COLORI
  36. #define COL_TITLES "{FFEE00}"
  37. #define COL_BIANCO "{FFFFFF}"
  38. #define COL_ROSSO "{F81414}"
  39. #define COL_VERDE "{00FF22}"
  40. #define COL_AZZU "{D6D8FF}"
  41. #define COL_BLU "{0000C1}"
  42. #define COLORE_POLIZIA 0x00D9E6FF
  43. #define COLORE_MEDICI 0xFF0000FF
  44. #define BIANCO 0xFFFFFFFF
  45. #define NERO 0x000000FF
  46. #define VERDE 0x005700FF
  47. #define BLU 0x0000FFFF
  48. #define GIALLO 0xFFEE00FF
  49. #define GIALLOSCURO 0xFFB900FF
  50. #define ARANCIONE 0xFF6600FF
  51. #define GRIGIO 0xAFAFAFAA
  52. #define ROSSO 0xFF0000FF
  53. #define COLOR_FADE1 0xE6E6E6E6
  54. #define COLOR_FADE2 0xC8C8C8C8
  55. #define COLOR_FADE3 0xAAAAAAAA
  56. #define COLOR_FADE4 0x8C8C8C8C
  57. #define COLOR_FADE5 0x6E6E6E6E
  58. #define COLOR_GRAD1 0xB4B5B7FF
  59. #define COLOR_GRAD2 0xBFC0C2FF
  60. #define COLOR_GRAD3 0xCBCCCEFF
  61. #define COLOR_GRAD4 0xD8D8D8FF
  62. #define COLOR_GRAD5 0xE3E3E3FF
  63. #define COLOR_GRAD6 0xF0F0F0FF
  64. #define DVERDE 0x5DFF00FF
  65.  
  66. //SISTEMA DROGA
  67. new d_lavorazione[MAX_PLAYERS] = 0;
  68. new maschera[MAX_PLAYERS] = 0;
  69.  
  70. enum hCompra
  71. {
  72.     hRichiesta,
  73. };
  74. new CompraInfo[MAX_PLAYERS][hCompra];
  75.  
  76. enum nInfo
  77. {
  78.         nPiantaF,
  79.         nPiantaI,
  80.         Float:nX,
  81.         Float:nY,
  82.         Float:nZ,
  83.         nVaso,
  84.         nPiantati,
  85.         nRaccoglibili
  86. };
  87. new SemiInfo[MAX_PLAYERS][nInfo];
  88.  
  89. enum pInfo
  90. {
  91.         pPassword,
  92.         pAdmin,
  93.         pHelper,
  94.         pSoldi,
  95.         pSkin,
  96.         pSkins,
  97.         pSesso,
  98.         pAnni,
  99.         pContobanca,
  100.         pContobancario,
  101.         pLock,
  102.         pBan,
  103.         pExp,
  104.         pLivello,
  105.         pPolizia,
  106.         pPortoArmi,
  107.         pMedici,
  108.         Float:pHealth,
  109.         Float:pArmour,
  110.         Float:pLastX,
  111.         Float:pLastY,
  112.         Float:pLastZ,
  113.         Float:pFacingAngle,
  114.         pInt,
  115.         pPatente,
  116.         pLavori,
  117.         pSecondi,
  118.         pMinuti,
  119.         pOre,
  120.         pBomba,
  121.         pWorld,
  122.         pNome,
  123.         Float:Pos[4],
  124.         pBiglietti,
  125.         pBigliettiA,
  126.         pBilancio,
  127.         pC_Bancario,
  128.         BizID,
  129.         pCorda,
  130.         pMaskB,
  131.         pMaskR,
  132.         pMaskV,
  133.         pBorsa,
  134.         pKitMedico,
  135.         pInservizio,
  136.         pGPS,
  137.         pForbici,
  138.         pArresti,
  139.         pMulte,
  140.         pTelefono,
  141.         pFame,
  142.         pSete,
  143.         pPipi,
  144.         pSemini,//droga
  145.         pCanapa,//droga
  146.         pHashish,//droga
  147.         pAccendino,//droga
  148.         pCartine,//droga
  149.         Weapon1,
  150.         Weapon1a,
  151.         Weapon2,
  152.         Weapon2a,
  153.         Weapon3,
  154.         Weapon3a,
  155.         Weapon4,
  156.         Weapon4a,
  157.         Weapon5,
  158.         Weapon5a,
  159.         Weapon6,
  160.         Weapon6a,
  161.         Weapon7,
  162.         Weapon7a,
  163.         Weapon8,
  164.         Weapon8a,
  165.         Weapon9,
  166.         Weapon9a,
  167.         Weapon10,
  168.         Weapon10a,
  169.         Weapon11,
  170.         Weapon11a,
  171.         Weapon12,
  172.         Weapon12a,
  173. };
  174. new PlayerInfo[MAX_PLAYERS][pInfo];
  175.  
  176. //SISTEMA DROGA
  177. new Text3D:percentuale[MAX_PLAYERS];
  178. new Text3D:C_progresso[MAX_PLAYERS];
  179. new fumando[MAX_PLAYERS] = 0;
  180.  
  181. #if defined FILTERSCRIPT
  182.  
  183. public OnFilterScriptInit()
  184. {
  185.     print("\n--------------------------------------");
  186.     print(" Blank Filterscript by your name here");
  187.     print("--------------------------------------\n");
  188.     return 1;
  189. }
  190.  
  191. public OnFilterScriptExit()
  192. {
  193.     return 1;
  194. }
  195.  
  196. #else
  197.  
  198. main()
  199. {
  200.     print("\n----------------------------------");
  201.     print(" Blank Gamemode by your name here");
  202.     print("----------------------------------\n");
  203. }
  204.  
  205. #endif
  206.  
  207. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  208. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  209. {
  210.         if(IsPlayerConnected(playerid))
  211.         {
  212.                 new Float:posx, Float:posy, Float:posz;
  213.                 new Float:oldposx, Float:oldposy, Float:oldposz;
  214.                 new Float:tempposx, Float:tempposy, Float:tempposz;
  215.                 GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  216.                 for(new i = 0; i < MAX_PLAYERS; i++)
  217.                 {
  218.                         if(IsPlayerConnected(i))
  219.                         {
  220.                                 GetPlayerPos(i, posx, posy, posz);
  221.                                 tempposx = (oldposx -posx);
  222.                                 tempposy = (oldposy -posy);
  223.                                 tempposz = (oldposz -posz);
  224.                                 new playerworld, player2world;
  225.                                 playerworld = GetPlayerVirtualWorld(playerid);
  226.                                 player2world = GetPlayerVirtualWorld(i);
  227.                                 if(playerworld == player2world)
  228.                                 {
  229.                                         if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  230.                                         {
  231.                                                 SCM(i, col1, string);
  232.                                         }
  233.                                         else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  234.                                         {
  235.                                                 SCM(i, col2, string);
  236.                                         }
  237.                                         else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  238.                                         {
  239.                                                 SCM(i, col3, string);
  240.                                         }
  241.                                         else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  242.                                         {
  243.                                                 SCM(i, col4, string);
  244.                                         }
  245.                                         else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  246.                                         {
  247.                                                 SCM(i, col5, string);
  248.                                         }
  249.                                 }
  250.                                 else
  251.                                 {
  252.                                         SCM(i, col1, string);
  253.                                 }
  254.                         }
  255.                 }
  256.         }
  257.         return 1;
  258. }
  259.  
  260. stock RemoveUnderScore(playerid)
  261. {
  262.     new name[MAX_PLAYER_NAME];
  263.     GetPlayerName(playerid,name,sizeof(name));
  264.     for(new i = 0; i < MAX_PLAYER_NAME; i++)
  265.     {
  266.         if(name[i] == '_') name[i] = ' ';
  267.     }
  268.     return name;
  269. }
  270.  
  271. public OnGameModeInit()
  272. {
  273.         //PICKUP SISTEMA DROGA
  274.         CreatePickup(1239, 1, -394.9466,-1438.5430,25.7266, 0);
  275.         Create3DTextLabel("Premi Y per comprare i semini\nPrezzo: x", GIALLO, -394.9466,-1438.5430,25.7266, 3.0, 0, 0);
  276.         //pusher
  277.         CreateDynamicObject(1728, -394.43265, -1433.75049, 24.71736,   0.00000, 0.00000, -9.77999);
  278.         CreateDynamicObject(1728, -398.75510, -1434.79138, 24.71736,   0.00000, 0.00000, 12.84000);
  279.         CreateDynamicObject(931, -394.98648, -1436.74121, 24.13490,   0.00000, 0.00000, 181.55991);
  280.         CreateDynamicObject(931, -394.98651, -1436.74121, 23.67490,   0.00000, 0.00000, 181.55991);
  281.         CreateDynamicObject(931, -397.54623, -1436.76807, 24.13490,   0.00000, 0.00000, 181.55991);
  282.         CreateDynamicObject(931, -397.54620, -1436.76807, 23.67490,   0.00000, 0.00000, 181.55991);
  283.         CreateDynamicObject(1431, -396.10904, -1433.20947, 25.26240,   0.00000, 0.00000, -4.32000);
  284.         CreateDynamicObject(1431, -399.71973, -1434.26807, 25.26240,   0.00000, 0.00000, 72.12004);
  285.         CreateDynamicObject(19473, -395.71860, -1436.83862, 24.32960,   0.00000, 90.00000, 4.08000);
  286.         CreateDynamicObject(19473, -396.11682, -1437.16357, 24.32960,   -26.00000, 90.00000, 47.28001);
  287.         CreateDynamicObject(19473, -398.17075, -1437.03284, 23.44340,   0.00000, 0.00000, -17.88000);
  288.         CreateDynamicObject(19473, -395.30679, -1436.38940, 24.32960,   -26.00000, 90.00000, 1.68000);
  289.         CreateDynamicObject(19473, -397.07822, -1436.77246, 23.44340,   0.00000, 0.00000, 44.40000);
  290.         CreateDynamicObject(19473, -397.66141, -1436.98438, 23.44340,   0.00000, 0.00000, 0.42000);
  291.         CreateDynamicObject(19473, -397.17563, -1436.33337, 23.44340,   0.00000, 0.00000, 58.92003);
  292.         CreateDynamicObject(19473, -398.09915, -1436.38110, 23.44340,   0.00000, 0.00000, 58.92003);
  293.         printf("CreateDynamicObjects: %d", CountDynamicObjects());
  294.         return 1;
  295. }
  296.  
  297. public OnGameModeExit()
  298. {
  299.     return 1;
  300. }
  301.  
  302. public OnPlayerRequestClass(playerid, classid)
  303. {
  304.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  305.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  306.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  307.     return 1;
  308. }
  309.  
  310. public OnPlayerConnect(playerid)
  311. {
  312.     return 1;
  313. }
  314.  
  315. public OnPlayerDisconnect(playerid, reason)
  316. {
  317.     return 1;
  318. }
  319.  
  320. public OnPlayerSpawn(playerid)
  321. {
  322.     return 1;
  323. }
  324.  
  325. public OnPlayerDeath(playerid, killerid, reason)
  326. {
  327.     return 1;
  328. }
  329.  
  330. public OnVehicleSpawn(vehicleid)
  331. {
  332.     return 1;
  333. }
  334.  
  335. public OnVehicleDeath(vehicleid, killerid)
  336. {
  337.     return 1;
  338. }
  339.  
  340. public OnPlayerText(playerid, text[])
  341. {
  342.     return 1;
  343. }
  344.  
  345. public OnPlayerCommandText(playerid, cmdtext[])
  346. {
  347.     new tmp[128], cmd[128], idx;
  348.     cmd = strtok(cmdtext, idx);
  349.     if(strcmp(cmd, "/dvendi", true) == 0)
  350.     {
  351.         if(IsPlayerConnected(playerid))
  352.         {
  353.             tmp = strtok(cmdtext, idx);
  354.             if(!strlen(tmp))
  355.             {
  356.                 SendClientMessage(playerid, ROSSO, "Utilizzo: /dvendi [ID/Parte del nome] [Grammi] [Prezzo(da 300$ a 500$]");
  357.                 return 1;
  358.             }
  359.             new playa;
  360.             new money;
  361.             new needed;
  362.             playa = ReturnUser(tmp);
  363.             tmp = strtok(cmdtext, idx);
  364.             if(!strlen(tmp)) { return 1; }
  365.             needed = strval(tmp);
  366.             if(needed < 1 || needed > 99) { SendClientMessage(playerid, ROSSO, "   Grams not lower then 1, or above 99!"); return 1; }
  367.             tmp = strtok(cmdtext, idx);
  368.             if(!strlen(tmp)) { return 1; }
  369.             money = strval(tmp);
  370.             if(money < 1 || money > 99999) { SendClientMessage(playerid, ROSSO, "   Price not lower then 1, or above 99999!"); return 1; }
  371.             if(needed > PlayerInfo[playerid][pHashish]) { SendClientMessage(playerid, ROSSO, "   You dont have that much Drugs with you!"); return 1; }
  372.             if(IsPlayerConnected(playa))
  373.             {
  374.                 if(playa != INVALID_PLAYER_ID)
  375.                 {
  376.                     if (ProxDetector(8.0, playerid, playa))
  377.                     {
  378.                         if(playa == playerid)
  379.                         {
  380.                             SendClientMessage(playerid, ROSSO, "   Cant sell to yourself!");
  381.                             return 1;
  382.                         }
  383.                         GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  384.  
  385.                         format(string, sizeof(string), "* You offerd %s to buy %d gram of drugs for $%d .", giveplayer, needed, money);
  386.                         SendClientMessage(playerid, GIALLO, string);
  387.                         format(string, sizeof(string), "* Drug Dealer %s wants to sell you %d gram for $%d, (type /accept drugs) to buy.", sendername, needed, money);
  388.                         SendClientMessage(playa, GIALLO, string);
  389.                         DrugOffer[playa] = playerid;
  390.                         DrugPrice[playa] = money;
  391.                         DrugGram[playa] = needed;
  392.                     }
  393.                     else
  394.                     {
  395.                         SendClientMessage(playerid, ROSSO, "   That player is not near you!");
  396.                     }
  397.                 }
  398.             }
  399.             else
  400.             {
  401.                 SendClientMessage(playerid, ROSSO, "   That player is offline.");
  402.             }
  403.         }
  404.         return 1;
  405.     }
  406.     return 0;
  407. }
  408.  
  409. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  410. {
  411.     return 1;
  412. }
  413.  
  414. public OnPlayerExitVehicle(playerid, vehicleid)
  415. {
  416.     return 1;
  417. }
  418.  
  419. public OnPlayerStateChange(playerid, newstate, oldstate)
  420. {
  421.     return 1;
  422. }
  423.  
  424. public OnPlayerEnterCheckpoint(playerid)
  425. {
  426.     return 1;
  427. }
  428.  
  429. public OnPlayerLeaveCheckpoint(playerid)
  430. {
  431.     return 1;
  432. }
  433.  
  434. public OnPlayerEnterRaceCheckpoint(playerid)
  435. {
  436.     return 1;
  437. }
  438.  
  439. public OnPlayerLeaveRaceCheckpoint(playerid)
  440. {
  441.     return 1;
  442. }
  443.  
  444. public OnRconCommand(cmd[])
  445. {
  446.     return 1;
  447. }
  448.  
  449. public OnPlayerRequestSpawn(playerid)
  450. {
  451.     return 1;
  452. }
  453.  
  454. public OnObjectMoved(objectid)
  455. {
  456.     return 1;
  457. }
  458.  
  459. public OnPlayerObjectMoved(playerid, objectid)
  460. {
  461.     return 1;
  462. }
  463.  
  464. public OnPlayerPickUpPickup(playerid, pickupid)
  465. {
  466.     return 1;
  467. }
  468.  
  469. public OnVehicleMod(playerid, vehicleid, componentid)
  470. {
  471.     return 1;
  472. }
  473.  
  474. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  475. {
  476.     return 1;
  477. }
  478.  
  479. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  480. {
  481.     return 1;
  482. }
  483.  
  484. public OnPlayerSelectedMenuRow(playerid, row)
  485. {
  486.     return 1;
  487. }
  488.  
  489. public OnPlayerExitedMenu(playerid)
  490. {
  491.     return 1;
  492. }
  493.  
  494. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  495. {
  496.     return 1;
  497. }
  498.  
  499. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  500. {
  501.                 //SISTEMA DROGA
  502.         if(newkeys & KEY_YES && IsPlayerInRangeOfPoint(playerid, 1.0, -394.9466,-1438.5430,25.7266)){//semini
  503.         if(PlayerInfo[playerid][pSemini] == 10) return SCM(playerid, ROSSO, "Possiedi già 10 semini nell'inventario!");
  504.         else{
  505.         new string1[128];
  506.         PlayerInfo[playerid][pSemini]++;
  507.         format(string1, sizeof(string1), "Hai un numero di semini pari a %d",PlayerInfo[playerid][pSemini]);
  508.         SCM(playerid, GIALLO, string1);}
  509.  
  510.  
  511.         /*if(newkeys & KEY_YES && IsPlayerInRangeOfPoint(playerid, 1.0, -397.4359,-1438.6172,25.7266)){//canapa
  512.         if(PlayerInfo[playerid][pCanapa] == 1) return SCM(playerid, ROSSO, "Possiedi già 1 ettogrammo di Canapa!");
  513.         if(PlayerInfo[playerid][pCanapa] == 0){
  514.         PlayerInfo[playerid][pCanapa] = 1;
  515.         SCM(playerid, GIALLO, "Hai acquistato 1 ettogrammo di Canapa!");
  516.         }*/
  517.  
  518.  
  519.         if(newkeys & KEY_FIRE){
  520.         if(fumando[playerid] == 1){
  521.         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
  522.         SetPlayerWeather(playerid, 250);
  523.         SetPlayerTime(playerid, 20, 0);
  524.         SetPlayerDrunkLevel(playerid, 2100);}}
  525.  
  526.  
  527.         return 1;}
  528.  
  529.  
  530.         return 0;
  531. }
  532.  
  533. CMD:lavoracanapa(playerid, params[]){
  534. new Float:X, Float:Y, Float:Z;
  535. if(PlayerInfo[playerid][pCanapa] == 0) return SCM(playerid, ROSSO, "Devi prima produrre della Canapa!");
  536. if(PlayerInfo[playerid][pHashish] == 20) return SCM(playerid, ROSSO, "Possiedi già 20g di Hashish!");
  537. if(d_lavorazione[playerid] == 1) return SCM(playerid, ROSSO, "Stai già lavorando della canapa, attendi.");
  538. SCM(playerid, ARANCIONE, "Attendi 1 minuto...");
  539. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  540. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  541. PlayerInfo[playerid][pCanapa]--;
  542. GetPlayerPos(playerid, X, Y, Z);
  543. C_progresso[playerid] = Create3DTextLabel("0%\n Lavorazione in corso...", GIALLO, X, Y, Z, 4.0, 0, 0);
  544. d_lavorazione[playerid] = 1;
  545. SetTimerEx("C_Progresso1", 3000, false, "i", playerid);
  546. return 1;}
  547.  
  548. forward C_Progresso1(playerid);
  549. public C_Progresso1(playerid){
  550. Update3DTextLabelText(C_progresso[playerid], GIALLO, "10%\nLavorazione in corso...");
  551. SetTimerEx("C_Progresso2", 3000, false, "i", playerid);}
  552.  
  553. forward C_Progresso2(playerid);
  554. public C_Progresso2(playerid){
  555. Update3DTextLabelText(C_progresso[playerid], GIALLO, "20%\nLavorazione in corso...");
  556. SetTimerEx("C_Progresso3", 3000, false, "i", playerid);}
  557.  
  558. forward C_Progresso3(playerid);
  559. public C_Progresso3(playerid){
  560. Update3DTextLabelText(C_progresso[playerid], GIALLO, "30%\nLavorazione in corso...");
  561. SetTimerEx("C_Progresso4", 3000, false, "i", playerid);}
  562.  
  563. forward C_Progresso4(playerid);
  564. public C_Progresso4(playerid){
  565. Update3DTextLabelText(C_progresso[playerid], GIALLO, "40%\nLavorazione in corso...");
  566. SetTimerEx("C_Progresso5", 3000, false, "i", playerid);}
  567.  
  568. forward C_Progresso5(playerid);
  569. public C_Progresso5(playerid){
  570. Update3DTextLabelText(C_progresso[playerid], GIALLO, "50%\nLavorazione in corso...");
  571. SetTimerEx("C_Progresso6", 3000, false, "i", playerid);}
  572.  
  573. forward C_Progresso6(playerid);
  574. public C_Progresso6(playerid){
  575. Update3DTextLabelText(C_progresso[playerid], GIALLO, "60%\nLavorazione in corso...");
  576. SetTimerEx("C_Progresso7", 3000, false, "i", playerid);}
  577.  
  578. forward C_Progresso7(playerid);
  579. public C_Progresso7(playerid){
  580. Update3DTextLabelText(C_progresso[playerid], GIALLO, "70%\nLavorazione in corso...");
  581. SetTimerEx("C_Progresso8", 3000, false, "i", playerid);}
  582.  
  583. forward C_Progresso8(playerid);
  584. public C_Progresso8(playerid){
  585. Update3DTextLabelText(C_progresso[playerid], GIALLO, "80%\nLavorazione in corso...");
  586. SetTimerEx("C_Progresso9", 3000, false, "i", playerid);}
  587.  
  588. forward C_Progresso9(playerid);
  589. public C_Progresso9(playerid){
  590. Update3DTextLabelText(C_progresso[playerid], GIALLO, "90%\nLavorazione in corso...");
  591. SetTimerEx("C_Progresso10", 3000, false, "i", playerid);}
  592.  
  593. forward C_Progresso10(playerid);
  594. public C_Progresso10(playerid){
  595. Update3DTextLabelText(C_progresso[playerid], GIALLO, "100%\nLavorazione in corso...");
  596. SetTimerEx("C_Progresso11", 2000, false, "i", playerid);}
  597.  
  598. forward C_Progresso11(playerid);
  599. public C_Progresso11(playerid){
  600. PlayerInfo[playerid][pHashish]= PlayerInfo[playerid][pHashish] + 20;//20g
  601. ClearAnimations(playerid);
  602. SCM(playerid, GIALLO, "Hai prodotto 20g di Hashish!");
  603. Delete3DTextLabel(C_progresso[playerid]);}
  604.  
  605.  
  606.  
  607.  
  608. CMD:pianta(playerid, params[]){
  609. if(PlayerInfo[playerid][pCanapa] == 6) return SCM(playerid, ROSSO, "Possiedi già 6 ettogrammi di Canapa!");
  610. if(PlayerInfo[playerid][pSemini] <= 4) return SCM(playerid, ROSSO, "Ti servono prima 5 semini!");
  611. if(PlayerInfo[playerid][pHashish] == 20) return SCM(playerid, ROSSO, "Possiedi già 20g di Hashish!");
  612. if(SemiInfo[playerid][nPiantati] == 1) return SCM(playerid, ROSSO, "Sono stati già piantati 5 semini, attendi il completamento!");
  613. //--------//
  614. PlayerInfo[playerid][pSemini]= PlayerInfo[playerid][pSemini] - 5;
  615. SemiInfo[playerid][nPiantati] = 1;
  616. SetTimerEx("AnimazionePianta", 1000, false, "i", playerid);
  617. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  618. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  619. return 1;}
  620.  
  621. forward AnimazionePianta(playerid);
  622. public AnimazionePianta(playerid){
  623. ClearAnimations(playerid);
  624. GetPlayerPos(playerid, SemiInfo[playerid][nX], SemiInfo[playerid][nY], SemiInfo[playerid][nZ]);
  625. //SemiInfo[playerid][nPiantaF] = CreateDynamicObject(19473, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.6119, 0.0, 0.0, 0.0, 0);
  626. SemiInfo[playerid][nVaso] = CreateDynamicObject(2203, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-0.8196, 0.0, 0.0, 0.0, 0);
  627. percentuale[playerid] = Create3DTextLabel("0%", GIALLO, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.600, SemiInfo[playerid][nZ]-0.8196, 4.0, 0, 0);
  628. SetTimerEx("Pianta1", 50000, false, "i", playerid);}
  629. //----INIZIO CRESCITA PIANTINA----//
  630. forward Pianta1(playerid);
  631. public Pianta1(playerid){
  632. SemiInfo[playerid][nPiantaI] = CreateDynamicObject(862, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.5719, 0.0, 0.0, 0.0, 0);
  633. Update3DTextLabelText(percentuale[playerid], GIALLO, "10%");
  634. SetTimerEx("Pianta2", 50000, false, "i", playerid);}
  635.  
  636. forward Pianta2(playerid);
  637. public Pianta2(playerid){
  638. MoveDynamicObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.3319, 0.005);//1
  639. Update3DTextLabelText(percentuale[playerid], GIALLO, "20%");
  640. SetTimerEx("Pianta3", 50000, false, "i", playerid);}
  641.  
  642. forward Pianta3(playerid);
  643. public Pianta3(playerid){
  644. MoveDynamicObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.1, 0.005);//2
  645. Update3DTextLabelText(percentuale[playerid], GIALLO, "30%");
  646. SetTimerEx("Pianta4", 50000, false, "i", playerid);}
  647.  
  648. forward Pianta4(playerid);
  649. public Pianta4(playerid){
  650. MoveDynamicObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-2.0, 0.005);//3
  651. Update3DTextLabelText(percentuale[playerid], GIALLO, "40%");
  652. SetTimerEx("Pianta5", 50000, false, "i", playerid);}
  653.  
  654. forward Pianta5(playerid);
  655. public Pianta5(playerid){
  656. MoveDynamicObject(SemiInfo[playerid][nPiantaI], SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-1.7719, 0.009);//4
  657. Update3DTextLabelText(percentuale[playerid], GIALLO, "50%");
  658. SetTimerEx("Pianta6", 50000, false, "i", playerid);}
  659. //----FINE CRESCITA PIANTINA----//
  660. //----INIZIO CRESCITA CANAPA----//
  661. forward Pianta6(playerid);
  662. public Pianta6(playerid){
  663. DestroyDynamicObject(SemiInfo[playerid][nPiantaI]);
  664. SemiInfo[playerid][nPiantaF] = CreateDynamicObject(19473, SemiInfo[playerid][nX], SemiInfo[playerid][nY]-0.6000, SemiInfo[playerid][nZ]-0.7800, 0.0, 0.0, 0.0, 0);
  665. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFFE9FF00 );
  666. Update3DTextLabelText(percentuale[playerid], GIALLO, "60%");
  667. SetTimerEx("Pianta7", 50000, false, "i", playerid);}
  668.  
  669. forward Pianta7(playerid);
  670. public Pianta7(playerid){
  671. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFFCCFF00);
  672. Update3DTextLabelText(percentuale[playerid], GIALLO, "70%");
  673. SetTimerEx("Pianta8", 50000, false, "i", playerid);}
  674.  
  675. forward Pianta8(playerid);
  676. public Pianta8(playerid){
  677. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFFB6FF00);
  678. Update3DTextLabelText(percentuale[playerid], GIALLO, "80%");
  679. //SemiInfo[playerid][nRaccoglibili] = 1;
  680. SetTimerEx("Pianta9", 50000, false, "i", playerid);}
  681.  
  682. forward Pianta9(playerid);
  683. public Pianta9(playerid){
  684. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF4CFF00);
  685. Update3DTextLabelText(percentuale[playerid], GIALLO, "90%");
  686. SetTimerEx("Pianta10", 50000, false, "i", playerid);}
  687.  
  688. forward Pianta10(playerid);
  689. public Pianta10(playerid){
  690. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF33AA00);
  691. Update3DTextLabelText(percentuale[playerid], GIALLO, "100%");
  692. SetTimerEx("Pianta11", 50000, false, "i", playerid);}
  693. //----FINE CRESCITA CANAPA-----------------------------------------------------------------------------------------
  694. //----INIZIO SECC.----//
  695. forward Pianta11(playerid);
  696. public Pianta11(playerid){
  697. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF666600);
  698. Update3DTextLabelText(percentuale[playerid], ROSSO, "Attenzione, la pianta inizia a seccare! (2 min.)\n 0%");
  699. SetTimerEx("Pianta12", 20000, false, "i", playerid);}
  700.  
  701. forward Pianta12(playerid);
  702. public Pianta12(playerid){
  703. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF876500);
  704. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(1 min. 40 sec.)\n 20%");
  705. SemiInfo[playerid][nRaccoglibili] = 3;//<----------------------
  706. SetTimerEx("Pianta13", 20000, false, "i", playerid);}
  707.  
  708. forward Pianta13(playerid);
  709. public Pianta13(playerid){
  710. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF664C00);
  711. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(1 min. 20 sec.)\n 40%)");
  712. SemiInfo[playerid][nRaccoglibili] = 2;//<----------------------
  713. SetTimerEx("Pianta14", 20000, false, "i", playerid);}
  714.  
  715. forward Pianta14(playerid);
  716. public Pianta14(playerid){
  717. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF543900);
  718. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(1 min.)\n 60%");
  719. SemiInfo[playerid][nRaccoglibili] = 2;//<----------------------
  720. SetTimerEx("Pianta15", 20000, false, "i", playerid);}
  721.  
  722. forward Pianta15(playerid);
  723. public Pianta15(playerid){
  724. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF442F02);
  725. Update3DTextLabelText(percentuale[playerid], DVERDE, "Attenzione, la pianta sta seccando!\n Puoi iniziare a raccogliere!(40 sec.)\n 80%");
  726. SemiInfo[playerid][nRaccoglibili] = 1;//<----------------------
  727. SetTimerEx("Pianta16", 20000, false, "i", playerid);}
  728.  
  729. forward Pianta16(playerid);
  730. public Pianta16(playerid){
  731. SetDynamicObjectMaterial(SemiInfo[playerid][nPiantaF], 0, 19473, "grasshouse", "veg_marijuana", 0xFF382600);
  732. Update3DTextLabelText(percentuale[playerid], ROSSO, "Attenzione, la pianta è quasi completamente seccata!\n Non puoi più raccogliere.(20 sec.)\n 100%");
  733. SemiInfo[playerid][nRaccoglibili] = 0;//<----------------------
  734. SetTimerEx("Pianta17", 20000, false, "i", playerid);}
  735. //----FINE SECC.----//
  736. forward Pianta17(playerid);
  737. public Pianta17(playerid){
  738. DestroyDynamicObject(SemiInfo[playerid][nPiantaF]);
  739. SetTimerEx("DistruggiVaso", 2000, false, "i", playerid);
  740. Delete3DTextLabel(percentuale[playerid]);}
  741.  
  742. forward DistruggiVaso(playerid);
  743. public DistruggiVaso(playerid){
  744. SemiInfo[playerid][nPiantati] = 0;
  745. DestroyDynamicObject(SemiInfo[playerid][nVaso]);}
  746.  
  747. //3 minuti 180000 + 30 secondi 30000 = 210000 diviso 10 timer = 21000 tick (21 secondi)
  748.  
  749. CMD:draccogli(playerid, params[]){
  750. if(PlayerInfo[playerid][pHashish] == 20) return SCM(playerid, ROSSO, "Possiedi già 20g di Hashish!");
  751. if(PlayerInfo[playerid][pCanapa] == 6) return SCM(playerid, ROSSO, "Possiedi già 6 ettogrammi di Canapa!");
  752. if(!IsPlayerInRangeOfPoint(playerid, 1.5, SemiInfo[playerid][nX], SemiInfo[playerid][nY], SemiInfo[playerid][nZ])){
  753. SCM(playerid, ROSSO, "Devi essere vicino ad una piantina raccoglibile!");}else{
  754. if(SemiInfo[playerid][nPiantati] == 1){
  755. if(SemiInfo[playerid][nRaccoglibili] == 0) return SCM(playerid, ROSSO, "Ancora non puoi raccogliere, attendi!");}
  756. //------------------------------------------//
  757. if(SemiInfo[playerid][nPiantati] == 1){
  758. if(SemiInfo[playerid][nRaccoglibili] == 1){
  759. PlayerInfo[playerid][pCanapa]++;}
  760. else if(SemiInfo[playerid][nRaccoglibili] == 2){
  761. PlayerInfo[playerid][pCanapa]++;
  762. PlayerInfo[playerid][pCanapa]++;}
  763. else if(SemiInfo[playerid][nRaccoglibili] == 3){
  764. PlayerInfo[playerid][pCanapa]++;
  765. PlayerInfo[playerid][pCanapa]++;
  766. PlayerInfo[playerid][pCanapa]++;}}
  767. SemiInfo[playerid][nRaccoglibili] = 0;
  768. SemiInfo[playerid][nPiantati] = 0;
  769. SetTimerEx("AnimazioneRaccogli", 2500, false, "i", playerid);
  770. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  771. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);}
  772. return 1;}
  773.  
  774. forward AnimazioneRaccogli(playerid);
  775. public AnimazioneRaccogli(playerid){
  776. ClearAnimations(playerid);
  777. DestroyDynamicObject(SemiInfo[playerid][nPiantaF]);
  778. Delete3DTextLabel(percentuale[playerid]);
  779. SetTimerEx("DistruzioneVaso", 2000, false, "i", playerid);}
  780.  
  781. forward DistruzioneVaso(playerid);
  782. public DistruzioneVaso(playerid){
  783. DestroyDynamicObject(SemiInfo[playerid][nVaso]);}
  784.  
  785. CMD:usadroga(playerid, params[]){
  786. new string[500];
  787. if(PlayerInfo[playerid][pHashish] == 0) return SCM(playerid, ROSSO, "Devi prima acquistare/produrre hashish!");
  788. if(PlayerInfo[playerid][pCartine] == 0) return SCM(playerid, ROSSO, "Devi comprare una cartina lunga!");
  789. if(PlayerInfo[playerid][pAccendino] == 0) return SCM(playerid, ROSSO, "Non possiedi un accendino!");
  790. if(!IsPlayerInAnyVehicle(playerid)){
  791. if(maschera[playerid] == 0){
  792. 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));
  793. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}
  794. else if(maschera[playerid] == 1){
  795. format(string, sizeof(string), "* Uomo Mascherato[ID:%d] inizia a sciogliere l'Hashish con un accendino per poi rollarlo nella cartina lunga. *", playerid);
  796. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}}
  797.  
  798. if(IsPlayerInAnyVehicle(playerid)){
  799. if(maschera[playerid] == 0){
  800. 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));
  801. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}
  802. else if(maschera[playerid] == 1){
  803. format(string, sizeof(string), "* Uomo Mascherato[ID:%d] inizia a sciogliere l'Hashish con un accendino per poi rollarlo nella cartina lunga. *", playerid);
  804. ProxDetector(30.0, playerid, string, GIALLO,GIALLO,GIALLO,GIALLO,GIALLO);}}
  805. SCM(playerid, GIALLO, "Attendi 10 secondi...");
  806. SetTimerEx("Rolla", 10000, false, "i", playerid);
  807. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  808. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.0, 1, 0, 0, 0, 0);
  809. PlayerInfo[playerid][pHashish]--;
  810. PlayerInfo[playerid][pCartine]--;
  811. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
  812. fumando[playerid] = 1;
  813. SetTimerEx("FineH", 240000, false, "i", playerid);
  814. return 1;}
  815.  
  816. forward Rolla(playerid);
  817. public Rolla(playerid){
  818. ClearAnimations(playerid);}
  819.  
  820.  
  821. forward FineH(playerid);
  822. public FineH(playerid){
  823. fumando[playerid] = 0;
  824. ClearAnimations(playerid);}
  825.  
  826. CMD:dvendi(playerid, params[]){
  827. new id, grammi, prezzo, string1[128];
  828. if(PlayerInfo[playerid][pHashish] == 0) return SCM(playerid, ROSSO, "ERRORE: non possiedi Hashish!");
  829. if(sscanf(params, "udd", id, grammi, prezzo)) return SCM(playerid, ROSSO, "Utilizzo: /dvendi [ID] [Grammi] [Prezzo (da 300$ a 500$)]");
  830. if(id == playerid) return SCM(playerid, ROSSO, "ERRORE: non puoi venderti la droga!");
  831. if(id == INVALID_PLAYER_ID) return SCM(playerid, ROSSO, "ERRORE: Player/ID invalido!");
  832. if(grammi > PlayerInfo[playerid][pHashish]) return SCM(playerid, ROSSO, "ERRORE: non possiedi tutti questi grammi!");
  833. if(prezzo < 300 || prezzo > 500) return SCM(playerid, ROSSO, "ERRORE: il prezzo non è compreso tra 300$ e 500$!");
  834. format(string1, sizeof(string1), "%s vuole venderti %d g di Hashish a %d $. Fai /daccetta o /drifiuta.", playerid, grammi, prezzo);
  835. SCM(id, GIALLO, string1);
  836. SCM(playerid, GIALLO, "In attesa di una risposta...");
  837. CompraInfo[playerid][hRichiesta] = 1;
  838. return 1;}
  839.  
  840.  
  841.  
  842. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  843. {
  844.     return 1;
  845. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement