mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Update server_publishVehicle3.sqf
This partially reverts f2360a9
Moved cargo fill after setPos because holding vehicle at [0,0,0] (water
location) too long may cause it to explode.
This commit is contained in:
@@ -23,11 +23,11 @@ if (isServer) then {
|
||||
//Send request
|
||||
_key = format["CHILD:304:%1:",_id];
|
||||
_key call server_hiveWrite;
|
||||
diag_log format["DELETE: Player %1(%2) deleted object with ID: %3",_activatingPlayer, _PlayerUID, _id];
|
||||
diag_log format["DELETE: Player %1(%2) deleted object with ID: %3",(_activatingPlayer call fa_plr2str), _PlayerUID, _id];
|
||||
} else {
|
||||
//Send request
|
||||
_key = format["CHILD:310:%1:",_uid];
|
||||
_key call server_hiveWrite;
|
||||
diag_log format["DELETE: Player %1(%2) deleted object with UID: %3",_activatingPlayer, _PlayerUID, _uid];
|
||||
diag_log format["DELETE: Player %1(%2) deleted object with UID: %3",(_activatingPlayer call fa_plr2str), _PlayerUID, _uid];
|
||||
};
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||
|
||||
private ["_characterID","_minutes","_newObject","_playerID","_playerName","_key","_pos","_infected","_sourceName","_sourceWeapon","_distance","_message","_method","_suicide","_bodyName","_type","_english"];
|
||||
private ["_characterID","_minutes","_newObject","_playerID","_playerName","_key","_pos","_infected","_sourceName","_sourceWeapon","_distance","_message","_method","_suicide","_bodyName","_type"];
|
||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||
|
||||
_characterID = _this select 0;
|
||||
@@ -74,34 +74,13 @@ if (_playerName != "unknown" or _sourceName != "unknown") then {
|
||||
_bodyName = _message select 1;
|
||||
|
||||
if (_type == "killed" && _sourceName == "AI") then {
|
||||
_message set [2,"AI"];
|
||||
_message set [2, (localize "STR_PLAYER_AI")];
|
||||
};
|
||||
|
||||
_english = [ //Do not use localize on server machine
|
||||
"shot","a gunshot wound.",
|
||||
"shothead","a gunshot to the head.",
|
||||
"shotheavy","a large calibre gunshot.",
|
||||
"bled","blood loss.",
|
||||
"dehyd","dehydration.",
|
||||
"sick","infection.",
|
||||
"starve","starvation.",
|
||||
"combatlog","combat logging.",
|
||||
"explosion","an explosion.",
|
||||
"unknown","an unknown cause.",
|
||||
"zombie","the infected.",
|
||||
"fall","falling.",
|
||||
"crash","a vehicle crash.",
|
||||
"runover","being run over.",
|
||||
"eject","falling out of a moving vehicle.",
|
||||
"melee","blunt force trauma.",
|
||||
"rad","radiation.",
|
||||
"crushed","being crushed."
|
||||
];
|
||||
|
||||
_message = switch _type do {
|
||||
case "died": {format ["%1 died from %2", _bodyName, (_english select ((_english find (_message select 2))+1))]};
|
||||
case "killed": {format ["%1 was killed by %2 with a %3 from %4m", _bodyName, _message select 2, _message select 3, _message select 4]};
|
||||
case "suicide": {format ["%1 committed suicide", _bodyName]};
|
||||
case "died": {format [localize "str_player_death_died", _bodyName, localize format["str_death_%1",_message select 2]]};
|
||||
case "killed": {format [localize "str_player_death_killed", _bodyName, _message select 2, _message select 3, _message select 4]};
|
||||
case "suicide": {format [localize "str_player_death_suicide", _bodyName]};
|
||||
};
|
||||
diag_log format["DeathMessage: %1",_message];
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ if ([_object, "Server"] call check_publishobject) then {
|
||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
|
||||
|
||||
#ifdef OBJECT_DEBUG
|
||||
diag_log format["PUBLISH: Player %1(%2) created %3 with UID:%4 CID:%5 @%6 inventory:%7",_player,_playerUID,_type,_objectUID,_characterID,((_worldspace select 1) call fa_coor2str),_inventory];
|
||||
diag_log format["PUBLISH: Player %1(%2) created %3 with UID:%4 CID:%5 @%6 inventory:%7",(_player call fa_plr2str),_playerUID,_type,_objectUID,_characterID,((_worldspace select 1) call fa_coor2str),_inventory];
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -99,5 +99,5 @@ if (_outcome != "PASS") then {
|
||||
PVDZE_veh_Init = _object;
|
||||
publicVariable "PVDZE_veh_Init";
|
||||
|
||||
diag_log format["PUBLISH: %1(%2) bought %3 with UID %4 @%5",_activatingPlayer,_playerUID,_class,_uid,(_location call fa_coor2str)];
|
||||
diag_log format["PUBLISH: %1(%2) bought %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str)];
|
||||
};
|
||||
|
||||
@@ -77,15 +77,12 @@ if (_outcome != "PASS") then {
|
||||
clearMagazineCargoGlobal _object;
|
||||
clearBackpackCargoGlobal _object;
|
||||
|
||||
// Remove marker
|
||||
deleteVehicle _object;
|
||||
[_objectID,_objectUID] call server_deleteObjDirect;
|
||||
|
||||
//_newobject = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
|
||||
_newobject = _class createVehicle [0,0,0];
|
||||
|
||||
// remove old vehicle from DB
|
||||
[_objectID,_objectUID] call server_deleteObjDirect;
|
||||
|
||||
// switch var to new vehicle at this point.
|
||||
_object = _newobject;
|
||||
|
||||
@@ -93,12 +90,12 @@ if (_outcome != "PASS") then {
|
||||
_object setVariable ["lastUpdate",diag_tickTime];
|
||||
_object setVariable ["CharacterID", _characterID, true];
|
||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
|
||||
|
||||
[_weapons,_magazines,_backpacks,_object] call server_addCargo;
|
||||
|
||||
_object setDir _dir;
|
||||
_object setPosATL _location;
|
||||
_object setVectorUp surfaceNormal _location;
|
||||
|
||||
[_weapons,_magazines,_backpacks,_object] call server_addCargo;
|
||||
|
||||
_object call fnc_veh_ResetEH;
|
||||
// for non JIP users this should make sure everyone has eventhandlers for vehicles.
|
||||
@@ -108,5 +105,5 @@ if (_outcome != "PASS") then {
|
||||
dze_waiting = "success";
|
||||
(owner _activatingPlayer) publicVariableClient "dze_waiting";
|
||||
|
||||
diag_log format["PUBLISH: %1(%2) upgraded %3 with UID %4 @%5",_activatingPlayer,_playerUID,_class,_uid,(_location call fa_coor2str)];
|
||||
diag_log format["PUBLISH: %1(%2) upgraded %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str)];
|
||||
};
|
||||
@@ -81,4 +81,4 @@ _object enableSimulation false;
|
||||
|
||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
|
||||
|
||||
diag_log format["PUBLISH: Player %1(%2) upgraded or downgraded object to %3 with UID:%4 @%5",_activatingPlayer,_playerUID,_class,_uid,((_worldspace select 1) call fa_coor2str)];
|
||||
diag_log format["PUBLISH: Player %1(%2) upgraded or downgraded object to %3 with UID:%4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,((_worldspace select 1) call fa_coor2str)];
|
||||
Reference in New Issue
Block a user