Advertisement
AdamKadmon

Untitled

Jan 31st, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. /**
  2. * ExileClient_action_stealFlag_condition
  3. *
  4. * Exile Mod
  5. * www.exilemod.com
  6. * © 2015 Exile Mod Team
  7. *
  8. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10. */
  11.  
  12. private["_flagObject","_result","_buildRights"];
  13. _flagObject = _this;
  14. _result = "";
  15. try
  16. {
  17. if (isNull _flagObject) then
  18. {
  19. throw "Invalid flag object";
  20. };
  21. if ((_flagObject getvariable ["ExileFlagStolen", 0]) isEqualTo 1) then
  22. {
  23. throw "Cannot steal a flag twice!";
  24. };
  25. if ((_flagObject distance2D player) > 2) then
  26. {
  27. throw "You are too far away!";
  28. };
  29. if (((getPosASL player) select 2) > (((getPosASL _flagObject) select 2) + 3)) then
  30. {
  31. throw "You can only steal flags at the bottom of the pole!";
  32. };
  33. _buildRights = _flagObject getVariable ["ExileTerritoryBuildRights",[]];
  34. if ((getPlayerUID player) in _buildRights) then
  35. {
  36. throw "You cannot steal your own flag!";
  37. };
  38. }
  39. catch
  40. {
  41. _result = _exception;
  42. };
  43. _result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement