Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. /*
  2. File: fn_cannabisSeed.sqf
  3. Author: Cobra
  4. Description:
  5. Plant and grow cannabis seeds.
  6. */
  7. private["_tent","_time","_amount","_halftime","_seedcheck"];
  8. _tent = nearestObjects [(getPos player),["CamoNet_INDP_Curator_F"], 10];
  9. _seedcheck = nearestObjects [(getPos player),["CamoNet_INDP_Curator_F"], 20];
  10. if(playerSide != civilian) exitWith {};
  11. if(life_seeded == 1) exitWith {hint "You already have seeds planted.";[true,"cannabisseed",1] call life_fnc_handleInv; };
  12. if(life_shovel == 0) exitWith {hint "You have not cultivated the land.";[true,"cannabisseed",1] call life_fnc_handleInv; };
  13. if(life_lightdrugfield == 0) exitWith {hint "There is not enough lighting to grow the drugs..";[true,"cannabisseed",1] call life_fnc_handleInv; };
  14. if ((count _tent) == 0) exitWith {hint "You are not close enough to the netting";[true,"cannabisseed",1] call life_fnc_handleInv; };
  15. _tent = (_tent select 0);
  16. //Check to see how many lights are placed...
  17. if(life_lightdrugfield == 1) then {
  18. _time = 100 + round(random 25);
  19. };
  20. if(life_lightdrugfield == 2) then {
  21. _time = 75 + round(random 25);
  22. };
  23. if(life_lightdrugfield == 3) then {
  24. _time = 50 + round(random 30);
  25. };
  26. _halftime = _time/2;
  27. _amount = 2 + round(random 3);
  28. life_action_inUse = true;
  29. player playAction "Medic";
  30. sleep 6;
  31. life_action_inUse = false;
  32. hintSilent "The cannabis seed has been planted.";
  33. life_seeded = 1;
  34. sleep 4;
  35. closeDialog 0;
  36. hint format ["Cannabis seeds usually take around %1 seconds to grow.",_time];
  37. sleep _halftime;
  38. if ((count _seedcheck) == 0) exitWith {hint "You need to be within 20 metres of the seeds to tend to them. You need to replant now.";[true,"cannabisseed",1] call life_fnc_handleInv; };
  39. _seedcheck = (_seedcheck select 0);
  40. hint format ["About %1 seconds left until the drugs grow.",_halftime];
  41. sleep _halftime;
  42. hint "Your seeds have grown.";
  43. player playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
  44. sleep 1;
  45. hint format ["You have gathered %1 cannabis plants.",_amount];
  46. [true,"cannabis",_amount] call life_fnc_handleInv;
  47. sleep 3;
  48. closeDialog 0;
  49. hint "You need to re-cultivate the land to grow more drugs.";
  50. life_seeded = 0;
  51. life_shovel = 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement