Advertisement
Guest User

hemp.sqf

a guest
Jun 2nd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. /*
  2. put together for DayZ Epoch
  3. Credits to Shogun338 from Insurrection gaming
  4. modified for separate "gather weed" script
  5. */
  6.  
  7. private ["_gearmenu","_playerPos","_nearWeed","_weed","_objectID","_objectUID"];
  8. _playerPos = getPosATL player;
  9. _hempqty = {_x == "ItemKiloHemp"} count magazines player;
  10. _nearWeed = count nearestObjects [_playerPos, ["fiberplant"], 4] > 0;
  11. _weed = nearestObject [player, "fiberplant"];
  12.  
  13. if !(_nearWeed) exitWith {
  14. cutText [format["You need to be near the weed plants in order to gather."], "PLAIN DOWN"];
  15. };
  16. if (_hempqty > 2) exitWith {
  17. cutText [format["WARNING: %1, You have maximum amount of weed in your inventory! You could get arrested by the police ;)", name player], "PLAIN DOWN"];
  18. };
  19. if (dayz_combat == 1) then {
  20. cutText [format["You are in Combat and Cannot Gather the Weed."], "PLAIN DOWN"];
  21. } else {
  22. disableSerialization;
  23. _gearmenu = FindDisplay 106;
  24. _gearmenu CloseDisplay 106;
  25. player playActionNow "Medic";
  26. r_interrupt = false;
  27. sleep 6;
  28. _objectID = _weed getVariable["ObjectID","0"];
  29. _objectUID = _weed getVariable["ObjectUID","0"];
  30. deleteVehicle _weed;
  31. [_objectID,_objectUID] call server_deleteObj;
  32. _weed setDamage 1;
  33. player addMagazine "ItemKiloHemp";
  34. sleep 2;
  35. cutText [format["You've Gathered Some Weed! Smoke that shit or sell it at Black market dealer!!"], "PLAIN DOWN"];
  36. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement