Files
DayZ-Epoch/SQF/dayz_server/compile/server_deleteObj.sqf
oiad e8dd8fac63 Stop server_publishVehicle3 duping a vehicle if hive fails to update (#1895)
* Stop server_publishVehicle3 duping a vehicle if hive fails to update

server_publishVehicle3 first creates the vehicle in the database then
reads it back to see if it's successful, previously it wasn't deleting
the vehicle if it failed.

Added a 1 second delay after the vehicle delete to stop duping of
vehicles also.

Fixed references to server_deleteObj that were using 2 parameters
instead of the required 3 and updated the example.

* Rework
2017-02-13 14:09:21 -05:00

23 lines
652 B
Plaintext

/*
[_objectID,_objectUID,_activatingPlayer] call server_deleteObj;
*/
private["_id","_uid","_key","_activatingPlayer"];
_id = _this select 0;
_uid = _this select 1;
_activatingPlayer = _this select 2;
if (isServer) then {
//remove from database
if (parseNumber _id > 0) then {
//Send request
_key = format["CHILD:304:%1:",_id];
_key call server_hiveWrite;
diag_log format["DELETE: Player %1 deleted object with ID: %2",_activatingPlayer,_id];
} else {
//Send request
_key = format["CHILD:310:%1:",_uid];
_key call server_hiveWrite;
diag_log format["DELETE: Player %1 deleted object with UID: %2",_activatingPlayer,_uid];
};
};