Xyberviri
Valued Member!
Sounds like a plan, what ever i get working ill post, have a diffrent intent i think helps get more things working
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
D:\arma2~1\arma2oaserver.exe -name=Wasteland -cfg=Wasteland_v1db.Chernarus\basic.cfg -config=Wasteland_v1db.Chernarus\config_wland.cfg -world=chernarus" -cpuCount=2 -noSplash -showScriptErrors
template = Wasteland_v1db.Chernarus;
SELECT instance_vehicle.id, instance_vehicle.inventory, instance_vehicle.parts, instance_vehicle.fuel, instance_vehicle.damage, vehicle.class_name, instance_vehicle.last_updated FROM vehicle RIGHT JOIN (instance_vehicle LEFT JOIN world_vehicle ON instance_vehicle.world_vehicle_id = world_vehicle.id) ON vehicle.id = world_vehicle.vehicle_id WHERE instance_vehicle.damage > 0
UPDATE instance_vehicle SET worldspace='"+strLocation+"' WHERE id='"+strVehID+"'
waitUntil{allowConnection};
_type = "UH1H_DZ";
_dir = (random 360);
_pos =[13485,4421,0];
_newPos = [_pos, 0, 100, 10, 0, 500, 0] call BIS_fnc_findSafePos;
diag_log format["Attempting to spawn new vehicle: %1 at location %2",_type,str(_newPos)];
// _newVehicle = ["UH1H_DZ",_newPosr] call object_spawnGoodVehicle; //object_spawnDamVehicle;
_veh = _type createVehicle _newPos; // [,, [], 0, "CAN_COLLIDE"];
_veh setDir _dir;
_veh setPos getPos _veh;
//_veh setVariable ["ObjectID",1,true];
_veh setVariable ["ObjectID", [_dir,_newPos] call dayz_objectUID2, true];
_hitpoints = _veh call vehicle_getHitpoints;
_dam = 0.05;
_veh setFuel 1;
_veh call fnc_vehicleEventHandler;
{
_hit = [_veh,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
} forEach _hitpoints;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
[_veh,_type] spawn server_updateObject;
dayzVehicleInit = _veh;
publicVariable "dayzVehicleInit";
diag_log("SERVER: Starting spawn routine.");
//Spawn objects
_countr = 0;
_count_veh = 0;
{
//Parse individual vehicle row
_countr = _countr + 1;
_idKey = _x select 1;
_type = _x select 2;
_ownerID = _x select 3;
_worldspace = _x select 4;
_dir = 0;
_pos = [0,0,0];
_wsDone = false;
if (count _worldspace >= 2) then
{
_dir = _worldspace select 0;
if (count (_worldspace select 1) == 3) then {
_pos = _worldspace select 1;
_wsDone = true;
}
};
if (!_wsDone) then {
if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
};
_intentory= _x select 5;
_hitPoints= _x select 6;
_fuel = _x select 7;
_damage = _x select 8;
if (_damage < 1) then {
diag_log("Spawned: " + str(_idKey) + " " + _type);
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
_object setVariable ["lastUpdate",time];
// Don't set objects for deployables to ensure proper inventory updates
if (_ownerID == "0") then {
_object setVariable ["ObjectID", str(_idKey), true];
} else {
_object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true];
};
_object setVariable ["CharacterID", _ownerID, true];
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
if (_object isKindOf "TentStorage") then {
_pos set [2,0];
_object setpos _pos;
};
_object setdir _dir;
_object setDamage _damage;
if (count _intentory > 0) then {
//Add weapons
_objWpnTypes = (_intentory select 0) select 0;
_objWpnQty = (_intentory select 0) select 1;
_countr = 0;
{
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgWeapons" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes;
//Add Magazines
_objWpnTypes = (_intentory select 1) select 0;
_objWpnQty = (_intentory select 1) select 1;
_countr = 0;
{
_isOK = isClass(configFile >> "CfgMagazines" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgMagazines" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes;
//Add Backpacks
_objWpnTypes = (_intentory select 2) select 0;
_objWpnQty = (_intentory select 2) select 1;
_countr = 0;
{
_isOK = isClass(configFile >> "CfgVehicles" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgVehicles" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes;
};
if (_object isKindOf "AllVehicles") then {
{
_selection = _x select 0;
_dam = _x select 1;
if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8};
[_object,_selection,_dam] call object_setFixServer;
} forEach _hitpoints;
_object setvelocity [0,0,1];
_object setFuel _fuel;
if (getDammage _object == 1) then {
_position = ([(getPosATL _object),0,100,10,0,500,0] call BIS_fnc_findSafePos);
if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
_object setPosATL _position;
};
_object call fnc_vehicleEventHandler;
_count_veh = _count_veh + 1;
};
//Monitor the object
//_object enableSimulation false;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
};
} forEach _objList;
diag_log ("SERVER: Spawned " + str(_count_veh) + " vehicles!");
private ["_id","_vehicle","_fsmcount"];
diag_log("Attempting to update FSM");
_id = _this select 0;
_vehicle = _this select 1;
_fsmcount = _thisFSM getFSMVariable "_safety";
diag_log ("Found FSM array with" + str(_fsmcount) + " objects");
_fsmcount set [count _fsmcount,_vehicle];
dayz_safety = _fsmcount;
_id setFSMVariable["_safety",_fsmcount];
_fsmcount = _thisFSM getFSMVariable "_safety";
diag_log ("updated FSM array has" + str(_fsmcount) + " objects");
if(true) exitWith{};
if (isDedicated) then {
_fsmid = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
"dayzUpdateCleanFSM" addPublicVariableEventHandler {[_fsmid,[_this select 1]] execVM "fixes\updateFSM.sqf"};
};
the above work im doing only require more mods if you DONT modify wasteland to ONLY generate dayz vehicles, it will be entirely possible to use wasteland with VanillaZ,should add the zombies from the UNdead mod. those are more realistic. people will need to download more add ons
//Clean groups
{
//diag_log ("CLEANUP: CHECKING GROUP WITH " + str(count units _x) + " UNITS");
if (count units _x==0) then {
deleteGroup _x;
//diag_log ("CLEANUP: DELETING A GROUP");
};
} forEach allGroups;
//Check for hackers
// {
// if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != "ParachuteWest") then {
// diag_log ("CLEANUP: KILLING A HACKER " + (name _x) + " " + str(_x) + " IN " + (typeOf vehicle _x));
// (vehicle _x) setDamage 1;
// _x setDamage 1;
// };
// } forEach allUnits;
//
//dayz_serverObjectMonitor = _safety;
_trigger = createTrigger["EmptyDetector",_position];
_trigger setTriggerArea[dayz_zSpawnDistance,dayz_zSpawnDistance,0,false];
_trigger setTriggerActivation["WEST","NOT PRESENT",false];