Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1.  
  2.  
  3. // Changes to exile.ini
  4.  
  5. [loadTerritory]
  6. SQL1_1 = SET @connector = ?;
  7. SQL2_1 = SELECT id,owner_uid,name,position_x,position_y,position_z,radius, level,flag_texture,flag_stolen,flag_stolen_by_uid,last_paid_at,build_rights,moderators,deleted_at,created_at,(SELECT COUNT(*)FROM construction c WHERE c.territory_id = @connector) FROM territory WHERE id = @connector
  8. Number Of Inputs = 1
  9. SQL1_INPUTS = 1
  10. OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9-STRING,10,11-STRING,12-DateTime_ISO8601,13,14,15,16,17
  11.  
  12. // Changes to ExileServer_system_territory_database_load.sqf
  13.  
  14. /**
  15. * ExileServer_system_territory_database_load
  16. *
  17. * Exile Mod
  18. * www.exilemod.com
  19. * © 2015 Exile Mod Team
  20. *
  21. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  22. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  23. */
  24.  
  25. private["_territoryID", "_data", "_id", "_owner", "_position", "_radius", "_level", "_flagTexture", "_flagStolen", "_flagStolenBy", "_lastPayed", "_buildRights", "_moderators", "_flagObject"];
  26. _territoryID = _this;
  27. _data = format ["loadTerritory:%1", _territoryID] call ExileServer_system_database_query_selectSingle;
  28. _id = _data select 0;
  29. _owner = _data select 1;
  30. _name = _data select 2;
  31. _position =
  32. [
  33. _data select 3,
  34. _data select 4,
  35. _data select 5
  36. ];
  37. _radius = _data select 6;
  38. _level = _data select 7;
  39. _flagTexture = _data select 8;
  40. _flagStolen = _data select 9;
  41. _flagStolenBy = _data select 10;
  42. _lastPayed = _data select 11;
  43. _buildRights = _data select 12;
  44. _moderators = _data select 13;
  45. _createdAt = _data select 15;
  46. _flagObject = createVehicle ["Exile_Construction_Flag_Static",_position, [], 0, "CAN_COLLIDE"];
  47. if (_flagStolen isEqualTo 0) then
  48. {
  49. _flagObject setFlagTexture _flagTexture;
  50. };
  51. ExileLocations pushBack _flagObject;
  52. _flagObject setVariable ["ExileTerritoryName", _name, true];
  53. _flagObject setVariable ["ExileDatabaseID", _id];
  54. _flagObject setVariable ["ExileOwnerUID", _owner, true];
  55. _flagObject setVariable ["ExileTerritorySize", _radius, true];
  56. _flagObject setVariable ["ExileTerritoryBuildRights", _buildRights, true];
  57. _flagObject setVariable ["ExileTerritoryModerators", _moderators, true];
  58. _flagObject setVariable ["ExileTerritoryLevel", _level, true];
  59. _flagObject setVariable ["ExileTerritoryLastPayed", _lastPayed];
  60. _flagObject call ExileServer_system_territory_maintenance_recalculateDueDate;
  61. _flagObject setVariable ["ExileTerritoryNumberOfConstructions", _data select 16, true]; // moved from 15 to 16
  62. _flagObject setVariable ["ExileTerritoryCreatedAt", _createdAt];
  63. _flagObject setVariable ["ExileRadiusShown", false, true];
  64. _flagObject setVariable ["ExileFlagStolen",_flagStolen,true];
  65. _flagObject setVariable ["ExileFlagTexture",_flagTexture];
  66. if (getNumber(missionConfigFile >> "CfgVirtualGarage" >> "enableVirtualGarage") isEqualTo 1) then
  67. {
  68. _data = format["loadTerritoryVirtualGarage:%1", _territoryID] call ExileServer_system_database_query_selectFull;
  69. _flagObject setVariable ["ExileTerritoryStoredVehicles", _data, true];
  70. };
  71. true
  72.  
  73. // Changes to ExileClient_action_stealFlag_condition.sqf
  74.  
  75. /**
  76. * ExileClient_action_stealFlag_condition
  77. *
  78. * Exile Mod
  79. * www.exilemod.com
  80. * © 2015 Exile Mod Team
  81. *
  82. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  83. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  84. */
  85.  
  86. private["_flagObject","_result","_buildRights","_saveTheBambis","_protectionMessage","_noMoreProtectionNow","_territory"];
  87. _flagObject = _this;
  88. _result = "";
  89. try
  90. {
  91. if (isNull _flagObject) then
  92. {
  93. throw "Invalid flag object";
  94. };
  95. if ((_flagObject getvariable ["ExileFlagStolen", 0]) isEqualTo 1) then
  96. {
  97. throw "Cannot steal a flag twice!";
  98. };
  99. if ((_flagObject distance2D player) > 2) then
  100. {
  101. throw "You are too far away!";
  102. };
  103. if (((getPosASL player) select 2) > (((getPosASL _flagObject) select 2) + 4)) then
  104. {
  105. throw "You cannot steal flags at the top of the pole!";
  106. };
  107. _buildRights = _flagObject getVariable ["ExileTerritoryBuildRights",[]];
  108. if ((getPlayerUID player) in _buildRights) then
  109. {
  110. throw "You cannot steal your own flag!";
  111. };
  112. // Prevent Low Level Raiding
  113. _saveTheBambis = getNumber (missionConfigFile >> "CfgSaveTheBambis" >> "enabled");
  114. _protectionMessage = getText (missionConfigFile >> "CfgSaveTheBambis" >> "protectionMessage");
  115. _noMoreProtectionNow = getNumber (missionConfigFile >> "CfgSaveTheBambis" >> "stopProtectionLevel");
  116. _territory = _flagObject call ExileClient_util_world_getTerritoryAtPosition;
  117. _createdAt = _flagObject getVariable ["ExileTerritoryCreatedAt","Blank!"];
  118. if !(isNull _territory) then
  119. {
  120. if ((_saveTheBambis > 0) && (_territory getVariable ["ExileTerritoryLevel", 1]) < _noMoreProtectionNow) then
  121. {
  122. //throw _protectionMessage;
  123. throw format["Created at: %1", _createdAt];
  124. };
  125. };
  126. }
  127. catch
  128. {
  129. _result = _exception;
  130. };
  131. _result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement