Sign in to follow this  
Followers 0
John

Spawning a persistent vehicle?

3 posts in this topic

Hi all,

Wondering if it is possible to spawn a persistent vehicle, I realize the issues around locking said vehicle.. but im not concerned with that, I just want to spawn a vehicle that will persist in the world and not be lockable.

Can anyone point me in the right direction ?  

Share this post


Link to post
Share on other sites

Just buy one put a pin (anything) and leave it unlock 

Nobody have pin than nobody can lock it ... 

Probably sell in 1 days ;-)

Share this post


Link to post
Share on other sites

From ExileServer_object_vehicle_createPersistentVehicle.sqf

/**
 * 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/.
 */
 
private["_className","_position","_direction","_usePositionATL","_pinCode","_vehicleObject"];
_className = _this select 0;
_position = _this select 1;
_direction = _this select 2;
_usePositionATL = _this select 3;
_pinCode = _this select 4;
_vehicleObject = createVehicle [_className, _position, [], 0, "CAN_COLLIDE"];
clearBackpackCargoGlobal _vehicleObject;
clearItemCargoGlobal _vehicleObject;
clearMagazineCargoGlobal _vehicleObject;
clearWeaponCargoGlobal _vehicleObject;
_position set[2, (_position select 2) + 0.25]; 
_vehicleObject setDir _direction;		
if (_usePositionATL) then
{
	_vehicleObject setPosATL _position;
}
else 
{
	_vehicleObject setPosASL _position;
};
_vehicleObject setVariable ["ExileIsPersistent", true];
_vehicleObject setVariable ["ExileAccessCode",_pinCode];
_vehicleObject addEventHandler ["GetOut", { _this call ExileServer_object_vehicle_event_onGetOut}];
_vehicleObject addMPEventHandler ["MPKilled", { _this call ExileServer_object_vehicle_event_onMPKilled}];
_vehicleObject call ExileServer_system_simulationMonitor_addVehicle;
_vehicleObject

So probably based at:

["_className","_position","_direction","_usePositionATL","_pinCode","_vehicleObject"];
["VEHICLE_CLASS","POSITION","DIRECTION","i dont know what it is","PIN","NOT SURE"] call ExileServer_object_vehicle_createPersistentVehicle;

Would work

And to add it to database:
ExileServer_object_vehicle_database_insert.sqf

/**
 * 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/.
 */
 
private["_vehicleObject","_position","_vectorDirection","_vectorUp","_data","_extDB2Message","_vehicleID"];
_vehicleObject = _this;
_position = getPosATL _vehicleObject;
_vectorDirection = vectorDir _vehicleObject;
_vectorUp = vectorUp _vehicleObject;
_data =
[
	typeOf _vehicleObject,
	_vehicleObject getVariable ["ExileOwnerUID", ""],
	locked _vehicleObject,
	_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 getVariable ["ExileAccessCode",""]
];
_extDB2Message = ["insertVehicle", _data] call ExileServer_util_extDB2_createMessage;
_vehicleID = _extDB2Message call ExileServer_system_database_query_insertSingle;
_vehicleObject setVariable["ExileDatabaseID", _vehicleID];
_vehicleObject setVariable["ExileIsPersistent", true];
_vehicleID

 

Edited by WD-40

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.