Jump to content

Rocketrolls

Member
  • Content Count

    8
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Rocketrolls

  • Rank
    Private

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So I am completely new and just needed a bit of help with a script. I want to make it save the owner of the vehicles and not save a type of vehicle. So I am using the Nassau 1715 mod, when it saves, it copies all the cannons again that are attached to the vessel. I want to exclude the cannons from the save as the vessel spawns new cannons each time. Also using a script that you buy the vehicles and can unlock and lock them. When this script loads them I don't think it's saving the owner. All help is appreciated, would love to add someone on discord who has the time and patience to help me. /* File: saveVehicles.sqf Author: xBowBii (aka xbwb) 08/03/15 */ SURV_VehiclesLoaded = false; waitUntil {SURV_VehiclesLoaded}; while {true} do { profileNamespace setVariable ["SURV_Vehicles",[]]; { _Vehs = profileNamespace getVariable ["SURV_Vehicles",[]]; _vehicle = _x; _xType = typeOf _x; _xPos = getPos _x; _xDir = getDir _x; _xDmg = damage _x; _xOwns = _x getVariable ["YOUR_OWN_CUSTOMVAR",[]]; _xFuel = fuel _x; _weapons = weaponCargo _x; _magazines = magazineCargo _x; _hitPoints = []; _cachekey = format["%1_HP", _xType]; _hitpoints = missionNamespace getVariable[_cachekey, []]; if (_hitpoints isEqualTo []) then { _na = configProperties[configFile >> "CfgVehicles" >> _xType >> "HitPoints", "_hitpoints pushBack configName _x; true", true]; missionNamespace setVariable[_cachekey, _hitpoints]; }; _finalHitPs = []; { _finalHitPs = _finalHitPs + [[_x,_vehicle getHitPointDamage _x]]; } forEach _hitPoints; profileNamespace setVariable ["SURV_Vehicles",(_vehs + [[_xtype,_xpos,_xdir,_xdmg,_xowns,_xFuel,_weapons,_magazines,_finalHitPs]])]; } forEach vehicles; saveProfileNamespace; sleep 20; }; and /* File: loadVehicles.sqf Author: xBowBii (aka xbwb) 08/03/15 */ _vehicles = profileNamespace getVariable ["SURV_Vehicles",nil]; { private ["_log","_vtype","_vpos","_vdir","_vdam","_veh","_vFuel","_vWeap","_vMags"]; _vType = _x select 0; _vPos = _x select 1; _vDir = _x select 2; _vDam = _x select 3; _vVar1 = _x select 4; _vFuel = _x select 5; _vWeap = _x select 6; _vMags = _x select 7; _hitp = _x select 8; //"extLOG" callExtension format["0:VehicleLogging: %1 at %2, with dmg %3. Fuel is %4, and Cargo is %5 && %6",_vType,_vPos,_vDam,_vFuel,_vWeap,_vMags]; if (_vDam == 1) exitWith {/* useless to spawn it */}; _veh = createVehicle [_vType, _vPos, [], 0, "CAN_COLLIDE"]; _veh setDir _vDir; _veh setDamage _vDam; removeAllWeapons _veh; removeAllItems _veh; _veh setVariable ["YOUR_OWN_CUSTOMVAR",_vVar1,true]; { _veh setHitPointDamage [(_x select 0), (_x select 1)]; } forEach _hitp; _veh setFuel _vFuel; { _veh addWeaponCargoGlobal [_x,1]; } forEach _vWeap; { _veh addMagazineCargoGlobal [_x,1]; } forEach _vMags; } forEach _vehicles; sleep 20; SURV_VehiclesLoaded = true; Thanks 🙂
  2. This works great but I am having an issue with it not saving the inventory of the player, can anyone help me out with this? 99% new to this. 😄
  3. How do i get it to save the owner as another script doesn't let me lock/unlock on restart. Very new, all help appreciated. Also looking for one to save unit pos, loadout, direction and so on. 😄
  4. @pierremgi That worked a treat! Thanks a lot
  5. [] spawn {sleep 60; {deleteVehicle _x} foreach (allunits select {_x inArea thisTrigger && side _x == Blufor}) }; Says undefined variable in thisTrigger when it tries to run the code. I don't see any red dots in the code. Cheers
  6. I am trying to use in the deact trigger box [] spawn {sleep 60; {deleteVehicle _x} foreach (allunits select {_x inArea thisTrigger && side _x == Blufor}) }; It just brings up error invalid number in expression... So what I am trying to do is when I leave the trigger zone the units will be deleted after around 10 minutes. lets say 60 seconds as your example. Appreciate the help 🙂
  7. Ha, just trying to build a mission but completely new to it. Came across this post on how to remove them. I just wondered if a delay can be added for say 15 minutes. 😄
×