Better combat log detection method on server

"noatlf4" variable is set on server through PV from damage handler. No
need to worry about diag_tickTime difference between clients and server.
This commit is contained in:
ebaydayz
2016-05-02 15:12:43 -04:00
parent c951680ffd
commit c4ed93959e
2 changed files with 5 additions and 7 deletions

View File

@@ -360,15 +360,14 @@ while {1 == 1} do {
_startcombattimer = player getVariable["startcombattimer", 0];
if (_startcombattimer == 1 || _PlayerNearby) then {
player setVariable["combattimeout", diag_tickTime + 30, true]; // Global used to punish combat log in server_onPlayerDisconnect
player setVariable["combattimeout", diag_tickTime + 30, false];
player setVariable["startcombattimer", 0, false];
} else {
if (_ZedsNearby && !_isPZombie) then {
player setVariable["combattimeout", diag_tickTime + 10, true]; // Global used to punish combat log in server_onPlayerDisconnect
player setVariable["combattimeout", diag_tickTime + 10, false];
player setVariable["startcombattimer", 0, false];
};
};
//setGroupIconsVisible [false,false];
//clearGroupIcons group player;
@@ -451,4 +450,4 @@ while {1 == 1} do {
_timerMonitor = diag_ticktime;
};
*/
};
};

View File

@@ -61,13 +61,12 @@ if (_characterID != "?") exitwith {
};
//Punish combat log
_timeout = _playerObj getVariable["combattimeout",0];
if (_timeout >= diag_tickTime) then {
if ((_lastDamage > 5 && {_lastDamage < 30}) && {alive _playerObj && (_playerObj distance (getMarkerpos "respawn_west") >= 2000)}) then {
_playerObj setVariable ["NORRN_unconscious",true,true]; // Set status to unconscious
_playerObj setVariable ["unconsciousTime",150,true]; // Set knock out timer to 150 seconds
//_playerObj setVariable ["USEC_injured",true]; // Set status to bleeding
//_playerObj setVariable ["USEC_BloodQty",3000]; // Set blood to 3000
diag_log format["PLAYER COMBAT LOGGED: %1(%4) (with %2s combat time remaining) at location %3",_playerName,(_timeout - diag_tickTime),_playerPos,_playerUID];
diag_log format["PLAYER COMBAT LOGGED: %1(%4) (with %2s combat time remaining) at location %3",_playerName,_lastDamage,_playerPos,_playerUID];
_message = format["PLAYER COMBAT LOGGED: %1",_playerName];
[nil, nil, rTitleText, _message, "PLAIN"] call RE; // Message whole server
};