Rappidxshots

CLOSE SOLVED]Cars Teleported to trader after restart help :)

14 posts in this topic

Posted (edited)

11 minutes ago, Rappidxshots said:

Try this code create a file called ExileServer_object_vehicle_database_update.sqf and add this code


/**
 * ExileServer_object_vehicle_database_update
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 *
 *
 * Modified by ynpmoose of ZeroSurvival.com / Vehicle Protection System
 */
 
private["_vehicleObject","_vehicleID","_position","_vectorDirection","_vectorUp","_availableHitpoints","_vehicleHitpoints","_data","_extDB2Message"];
_vehicleObject = _this;
_vehicleID = _vehicleObject getVariable ["ExileDatabaseID", -1];
if (_vehicleID > -1) then
{
	_position = getPosATL _vehicleObject;
	_vectorDirection = vectorDir _vehicleObject;
	_vectorUp = vectorUp _vehicleObject;
	_availableHitpoints = getAllHitPointsDamage _vehicleObject;
	_vehicleHitpoints = [];
	if!(_availableHitpoints isEqualTo [])then
	{
		{
			_vehicleHitpoints pushBack [_x ,_vehicleObject getHitPointDamage _x];
		}
		forEach (_availableHitpoints select 0);
	};
	_data =
	[
		_vehicleObject getVariable ["ExileIsLocked",-1],
		fuel _vehicleObject,
		damage _vehicleObject,
		_vehicleHitpoints,
		_position select 0,
		_position select 1,
		_position select 2,
		_vectorDirection select 0, 
		_vectorDirection select 1,
		_vectorDirection select 2,
		_vectorUp select 0,
		_vectorUp select 1,
		_vectorUp select 2,
		_vehicleObject call ExileServer_util_getItemCargo,
		magazinesAmmoCargo _vehicleObject,
		weaponsItemsCargo _vehicleObject,
		_vehicleObject call ExileServer_util_getObjectContainerCargo,
		_vehicleObject getVariable ["ExileMoney", 0],
		_vehicleID 
	];
	_extDB2Message = ["updateVehicle", _data] call ExileServer_util_extDB2_createMessage;
	_extDB2Message call ExileServer_system_database_query_fireAndForget;

// Vehicle Protection System
// Start: Vehicles Vulnerable Upon Save
	_vehicleObject allowDamage true;	
// End: Vehicles Vulnerable Upon Save

};
true

 

awesome Ill give it a shot and let ya know

Edited by Cody0520

Share this post


Link to post
Share on other sites

Posted (edited)

18 minutes ago, Rappidxshots said:

Try this code create a file called ExileServer_object_vehicle_database_update.sqf and add this code


/**
 * ExileServer_object_vehicle_database_update
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 *
 *
 * Modified by ynpmoose of ZeroSurvival.com / Vehicle Protection System
 */
 
private["_vehicleObject","_vehicleID","_position","_vectorDirection","_vectorUp","_availableHitpoints","_vehicleHitpoints","_data","_extDB2Message"];
_vehicleObject = _this;
_vehicleID = _vehicleObject getVariable ["ExileDatabaseID", -1];
if (_vehicleID > -1) then
{
	_position = getPosATL _vehicleObject;
	_vectorDirection = vectorDir _vehicleObject;
	_vectorUp = vectorUp _vehicleObject;
	_availableHitpoints = getAllHitPointsDamage _vehicleObject;
	_vehicleHitpoints = [];
	if!(_availableHitpoints isEqualTo [])then
	{
		{
			_vehicleHitpoints pushBack [_x ,_vehicleObject getHitPointDamage _x];
		}
		forEach (_availableHitpoints select 0);
	};
	_data =
	[
		_vehicleObject getVariable ["ExileIsLocked",-1],
		fuel _vehicleObject,
		damage _vehicleObject,
		_vehicleHitpoints,
		_position select 0,
		_position select 1,
		_position select 2,
		_vectorDirection select 0, 
		_vectorDirection select 1,
		_vectorDirection select 2,
		_vectorUp select 0,
		_vectorUp select 1,
		_vectorUp select 2,
		_vehicleObject call ExileServer_util_getItemCargo,
		magazinesAmmoCargo _vehicleObject,
		weaponsItemsCargo _vehicleObject,
		_vehicleObject call ExileServer_util_getObjectContainerCargo,
		_vehicleObject getVariable ["ExileMoney", 0],
		_vehicleID 
	];
	_extDB2Message = ["updateVehicle", _data] call ExileServer_util_extDB2_createMessage;
	_extDB2Message call ExileServer_system_database_query_fireAndForget;

// Vehicle Protection System
// Start: Vehicles Vulnerable Upon Save
	_vehicleObject allowDamage true;	
// End: Vehicles Vulnerable Upon Save

};
true

 

I get this error in the Logs,    


 

Error in expression <ct = _this;
_vehicleID = _vehicleObject getVariable ["ExileDatabaseID", -1];
if >
2017/06/19, 16:51:19   Error position: <getVariable ["ExileDatabaseID", -1];
if >
2017/06/19, 16:51:19   Error getvariable: Type Number, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
2017/06/19, 16:51:19 File mpmissions\Exile.Altis\overwrites\exile_server\code\ExileServer_object_vehicle_database_update.sqf, line 17

 

Edited by Cody0520

Share this post


Link to post
Share on other sites
Advertisement
2 hours ago, Cody0520 said:

I get this error in the Logs,    


 


Error in expression <ct = _this;
_vehicleID = _vehicleObject getVariable ["ExileDatabaseID", -1];
if >
2017/06/19, 16:51:19   Error position: <getVariable ["ExileDatabaseID", -1];
if >
2017/06/19, 16:51:19   Error getvariable: Type Number, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
2017/06/19, 16:51:19 File mpmissions\Exile.Altis\overwrites\exile_server\code\ExileServer_object_vehicle_database_update.sqf, line 17

 

I will message you to sort this :) 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.