Advertisement
Guest User

Untitled

a guest
May 24th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.91 KB | None | 0 0
  1. private["_selection","_state","_strH","_total","_unit"];
  2.  
  3.  
  4. //***Zupa Config ****//
  5.  
  6.  
  7. _godmodeVechilesEverywhere = false; // Godmode on all locked vehicles
  8. _onlyLockedVehicles = true; //Plotarea: Godmode for Only locked vehicles (true) or locked and unlocked(false)
  9. _onlyVehicleWithoutGear = true; // Only godmode on vehicles that hold no gear.
  10. _safeZoneGodVehicle = true; // Godmode vehicles in safezones. (or specific zone's)
  11.  
  12.  
  13. // donator plotpole only works with PLOT FOR LIFE, set FALSE if you dont have it.
  14. _donatorsPlots = false; // True = only godmode vehicles for donaters in the list, False = godmode for every guy.
  15. _plotDonators = ["76561198101253426","505"]; // PUID's of poeple who donated for plotpole
  16.  
  17.  
  18. // Chernarus safezone area's - change these to other coordinates for other maps. ( You can also add specific locations on the map.
  19. _safezones = [
  20. [[5070.75,9729.54],100,"Air"],
  21. [[1606.6443,7803.5156],100,"Bandit"],
  22. [[4063.4226,11664.19],100,"Bash"],
  23. [[12944.227,12766.889],100,"Hero"],
  24. [[11447.472,11364.504],100,"Klen"],
  25. [[6315.88,7791.3],100,"Stary"] // [[x,y],distance,"just name"]
  26. ];
  27.  
  28.  
  29. //***END Config ****//
  30.  
  31.  
  32. _unit = _this select 0;
  33. _selection = _this select 1;
  34. _total = _this select 2;
  35. _state = true;
  36.  
  37.  
  38. _HPBefore = -1;
  39.  
  40.  
  41. if (_selection != "") then {
  42. _strH = "hit_" + _selection;
  43. _HPBefore = [_unit,_strH] call object_getHit;
  44.  
  45.  
  46. } else {
  47. _strH = "totalDmg";
  48. _HPBefore = getDammage _unit;
  49.  
  50.  
  51.  
  52.  
  53. };
  54.  
  55.  
  56. if(_total > _HPBefore)then{
  57.  
  58.  
  59. if((locked _unit && _godmodeVechilesEverywhere && (count (crew _unit)) < 1))then{_state = false;
  60. };
  61.  
  62.  
  63. if(_state)then{
  64. if(_safeZoneGodVehicle )then{
  65. {if ((_unit distance (_x select 0)) < (_x select 1)) then {_state = false;
  66. };} forEach _safezones;
  67. };
  68. };
  69.  
  70.  
  71.  
  72.  
  73. if(_state)then{
  74. _gearCount = 0;
  75. if(_onlyVehicleWithoutGear)then{
  76. //_weaps = count(getWeaponCargo _unit);
  77. //_mags = count(getMagazineCargo _unit);
  78. //_backs = count(getBackpackCargo _unit);
  79. //_gearCount = _gearCount + _weaps + _mags + _backs;
  80. };
  81. _plots = nearestObjects [_unit, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  82. if((count(_plots) > 0))then{
  83. _thePlot = _plots select 0;
  84. _plotOwner = _thePlot getVariable ["ownerPUID",0];
  85. if ( (_gearCount == 0) &&(locked _unit || !(_onlyLockedVehicles) ) && (count (crew _unit)) < 1 && ( !(_donatorsPlots) || (_plotOwner in _plotDonators))) then {_state = false;
  86.  
  87. };
  88. };
  89. };
  90.  
  91. }; //fix
  92. if(_state)then{
  93.  
  94.  
  95. if (_total >= 0.98) then {
  96. _total = 1.0;
  97. };
  98.  
  99.  
  100. if (local _unit) then {
  101. if (_total > 0) then {
  102.  
  103.  
  104. _unit setVariable [_strH, _total, true];
  105. _unit setHit [_selection, _total];
  106.  
  107.  
  108. if (isServer) then {
  109. [_unit, "damage"] call server_updateObject;
  110. } else {
  111. PVDZE_veh_Update = [_unit,"damage"];
  112. publicVariableServer "PVDZE_veh_Update";
  113. };
  114. };
  115. } else {
  116. // vehicle is not local to this client, ask the client which vehicle is local to set damage
  117. /* PVS/PVC - Skaronator */
  118. PVDZE_send = [_unit,"VehHandleDam",_this];
  119. publicVariableServer "PVDZE_send";
  120. };
  121.  
  122.  
  123. }else{
  124. _total = _HPBefore;
  125. };
  126. // all "HandleDamage event" functions should return the effective damage that the engine will record for that part
  127.  
  128.  
  129. _total
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148. scriptName "Functions\misc\fn_damageHandler.sqf";
  149. /***********************************************************
  150. PROCESS DAMAGE TO A UNIT
  151. - Function
  152. - [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
  153. ************************************************************/
  154. private ["_unit","_hit","_damage","_total"];
  155. _unit = _this select 0;
  156. _hit = _this select 1;
  157. _damage = _this select 2;
  158. //_source = _this select 3;
  159. //_ammo = _this select 4;
  160. _total = _damage;
  161. _state = true;
  162.  
  163. //***Zupa Config ****//
  164.  
  165. _godmodeVechilesEverywhere = false; // Godmode on all locked vehicles
  166. _onlyLockedVehicles = true; //Plotarea: Godmode for Only locked vehicles (true) or locked and unlocked(false)
  167. _onlyVehicleWithoutGear = true; // Only godmode on vehicles that hold no gear.
  168. _safeZoneGodVehicle = true; // Godmode vehicles in safezones. (or specific zone's)
  169.  
  170. // donator plotpole only works with PLOT FOR LIFE, set FALSE if you dont have it.
  171. _donatorsPlots = false; // True = only godmode vehicles for donaters in the list, False = godmode for every guy.
  172. _plotDonators = ["76561198101253426","505"]; // PUID's of poeple who donated for plotpole
  173.  
  174. // Chernarus safezone area's - change these to other coordinates for other maps. ( You can also add specific locations on the map.
  175. _safezones = [
  176. [[5070.75,9729.54],100,"Air"],
  177. [[1606.6443,7803.5156],100,"Bandit"],
  178. [[4063.4226,11664.19],100,"Bash"],
  179. [[12944.227,12766.889],100,"Hero"],
  180. [[11447.472,11364.504],100,"Klen"],
  181. [[6315.88,7791.3],100,"Stary"] // [[x,y],distance,"just name"]
  182. ];
  183.  
  184. //***END Config ****//
  185.  
  186.  
  187. systemChat "checks";
  188. if((locked _unit && _godmodeVechilesEverywhere && (count (crew _unit)) < 1))then{_state = false;
  189. };
  190.  
  191. if(_state)then{
  192. if(_safeZoneGodVehicle )then{
  193. {if ((_unit distance (_x select 0)) < (_x select 1)) then {_state = false;
  194.  
  195. };} forEach _safezones;
  196. };
  197. };
  198.  
  199.  
  200. if(_state)then{
  201. _gearCount = 0;
  202. if(_onlyVehicleWithoutGear)then{
  203. //_weaps = count(getWeaponCargo _unit);
  204. //_mags = count(getMagazineCargo _unit);
  205. //_backs = count(getBackpackCargo _unit);
  206. //_gearCount = _gearCount + _weaps + _mags + _backs;
  207. };
  208. _plots = nearestObjects [_unit, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];
  209. if((count(_plots) > 0))then{
  210. _thePlot = _plots select 0;
  211. _plotOwner = _thePlot getVariable ["ownerPUID",0];
  212. if ( (_gearCount == 0) &&(locked _unit || !(_onlyLockedVehicles) ) && (count (crew _unit)) < 1 && ( !(_donatorsPlots) || (_plotOwner in _plotDonators))) then {_state = false;
  213.  
  214. };
  215. };
  216. };
  217.  
  218.  
  219.  
  220. //diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));
  221.  
  222. if (local _unit && _state) then {
  223. _total = [_unit,_hit,_damage] call object_setHitServer;
  224. };
  225. _total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement