Updated startcombattimer variable

This commit is contained in:
Florian Kinder
2014-02-20 18:01:16 +01:00
parent 6c0581bda9
commit bf13a783d9
5 changed files with 50 additions and 50 deletions

View File

@@ -101,7 +101,7 @@ if (_hit in USEC_MinorWounds) then {
if (_unitIsPlayer) then { if (_unitIsPlayer) then {
//incombat //incombat
_unit setVariable["startcombattimer", 1, false]; _unit setVariable["startcombattimer", 1];
}; };
if (_damage > 0.1) then { if (_damage > 0.1) then {

View File

@@ -33,7 +33,7 @@ while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do {
if (isPlayer _nearVehicle) then { if (isPlayer _nearVehicle) then {
_isInCombat = _nearVehicle getVariable["startcombattimer",0]; _isInCombat = _nearVehicle getVariable["startcombattimer",0];
if ((alive _nearVehicle) and _isInCombat == 0) then { if ((alive _nearVehicle) and _isInCombat == 0) then {
_nearVehicle setVariable["startcombattimer", 1, true]; _nearVehicle setVariable["startcombattimer", 1];
diag_log("Now in Combat (Player): " + name _unit); diag_log("Now in Combat (Player): " + name _unit);
}; };
}; };
@@ -42,7 +42,7 @@ while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do {
{ {
_isInCombat = _x getVariable["startcombattimer",0]; _isInCombat = _x getVariable["startcombattimer",0];
if (isPlayer _x and _isInCombat == 0 and alive _x) then { if (isPlayer _x and _isInCombat == 0 and alive _x) then {
_x setVariable["startcombattimer", 1, true]; _x setVariable["startcombattimer", 1];
diag_log("Now in Combat (Crew): " + name _x); diag_log("Now in Combat (Crew): " + name _x);
}; };
} forEach (crew _nearVehicle); } forEach (crew _nearVehicle);

View File

@@ -21,9 +21,9 @@ private ["_unit","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_
// Both the firer and those nearby (<=8m) go into "combat" to prevent ALT-F4 // Both the firer and those nearby (<=8m) go into "combat" to prevent ALT-F4
//diag_log ("DEBUG: AMMO TYPE: " +str(_ammo)); //diag_log ("DEBUG: AMMO TYPE: " +str(_ammo));
_firer setVariable["startcombattimer", 1, false]; _firer setVariable["startcombattimer", 1];
if (_distance <= 8) then { if (_distance <= 8) then {
_unit setVariable["startcombattimer", 1, false]; _unit setVariable["startcombattimer", 1];
}; };

View File

@@ -6,7 +6,7 @@ _unit = _array select 0;
_attacker = _array select 1; _attacker = _array select 1;
if (_unit == player && player distance _attacker < 5) then { if (_unit == player && player distance _attacker < 5) then {
player setVariable["startcombattimer", 1, false]; player setVariable["startcombattimer", 1];
// Make bleed // Make bleed
if (random 2 < 1) then { if (random 2 < 1) then {
// Find hit // Find hit

View File

@@ -218,7 +218,7 @@ while {true} do {
_startcombattimer = player getVariable["startcombattimer",0]; _startcombattimer = player getVariable["startcombattimer",0];
if (_startcombattimer == 1) then { if (_startcombattimer == 1) then {
player setVariable["combattimeout", time + 30, true]; player setVariable["combattimeout", time + 30, true];
player setVariable["startcombattimer", 0, true]; player setVariable["startcombattimer", 0];
dayz_combat = 1; dayz_combat = 1;
}; };