Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. private ["_victim", "_attacker","_weapon","_weapon_dmg","_distance","_damage","_weapon_img"];
  2. _victim = _this select 0;
  3. _attacker = _this select 1;
  4. _damage = _this select 2;
  5.  
  6. if (!isPlayer _victim || !isPlayer _attacker) exitWith {};
  7. if ((owner _victim) == (owner _attacker)) exitWith {
  8. _victim setVariable["AttackedBy", _victim, true];
  9. };
  10.  
  11. _weapon = (weaponState _attacker);
  12.  
  13. _vehicle = typeOf (vehicle _attacker);
  14.  
  15. if ((getText (configFile >> "CfgVehicles" >> _vehicle >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR"]) then {
  16. _weapon_dmg = getText (configFile >> 'CfgVehicles' >> _vehicle >> 'displayName');
  17. _weapon_img = gettext(configFile >> 'CfgVehicles' >> _vehicle >> 'picture');
  18. } else {
  19. _weapon_dmg = gettext (configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'displayName');
  20. _weapon_img = gettext(configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'picture');
  21. };
  22.  
  23. _distance = _victim distance _attacker;
  24.  
  25. diag_log format["PLAYERHIT: %1 was hit by %2 with %3 from %4m with %5 dmg", _victim, _attacker, _weapon_dmg, _distance, _damage];
  26.  
  27. _victim setVariable["AttackedBy", _attacker, true];
  28. _victim setVariable["AttackedByName", (name _attacker), true];
  29. _victim setVariable["AttackedByWeapon", _weapon_dmg, true];
  30. _victim setVariable["AttackedFromDistance", _distance, true];
  31. _victim setVariable["AttackedByWeaponImg", _weapon_img, true];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement