calamity Posted October 10, 2014 Report Share Posted October 10, 2014 has anyone seen a script that would move loot from exploded vehicle to scatter around the ground example.... I'm driving and hit a tree my vehicle explodes, all the loot in its inventory is scattered around the ground . Theodore.Hill 1 Link to comment Share on other sites More sharing options...
0 Gr8 Posted October 11, 2014 Report Share Posted October 11, 2014 vehicle_handleKilled.sqf private["_unit","_hitPoints","_selection","_killer"]; _unit = _this select 0; _killer = _this select 1; _hitPoints = _unit call vehicle_getHitpoints; { _selection = getText (configFile >> "CfgVehicles" >> (typeof _unit) >> "HitPoints" >> _x >> "name"); _unit setVariable [_selection, 1, true]; } count _hitPoints; //["PVDZE_veh_Update",[_unit, "damage"]] call callRpcProcedure; if (isServer) then { [_unit, "killed"] call server_updateObject; } else { if (DZE_Debug_Damage && ((!isPlayer _unit) || ((isPlayer _unit) && (vehicle _unit != _unit) && (_unit != _killer)))) then { PVDZE_veh_Update = [_unit, "killed",_killer]; _killerVeh = if (vehicle _killer != _killer) then { format["[KILLER IN VEHICLE %1 OF TYPE %2]", (vehicle _killer), (typeOf (vehicle _killer))]; } else {""}; _name = if (alive _killer) then { name _killer; } else { format["OBJECT %1", _killer]; }; // diag_log format["DAMAGE: Vehicle %1 (TYPE: %2) Killed by player %3 (UID: %4) %5",_unit, (typeOf _unit), _name, (getPlayerUID _killer), _killerVeh]; } else { PVDZE_veh_Update = [_unit, "killed"]; }; publicVariableServer "PVDZE_veh_Update"; }; _unit removeAllEventHandlers "HandleDamage"; _unit removeAllEventHandlers "Killed"; _unit removeAllEventHandlers "GetIn"; _unit removeAllEventHandlers "GetOut"; //_var = round ((random 9) + 1); Xvar = true; ///test if (Xvar) then { _wep = getWeaponCargo _unit; _mags = getMagazineCargo _unit; _pos = getPosATL _unit; //create weaponHolder _tempContainer = createVehicle ["weaponHolder", [(_pos select 0) + 5, (_pos select 1) + 5, (_pos select 2)], [], 0, "can_collide"]; //add items to weaponHolder { _tempContainer addWeaponCargoGlobal [_x,1]; } forEach _wep; { _tempContainer addMagazineCargoGlobal [_x,1]; } forEach _mags; }; Theodore.Hill 1 Link to comment Share on other sites More sharing options...
0 carl101 Posted October 11, 2014 Report Share Posted October 11, 2014 Sweet, does this work well? Link to comment Share on other sites More sharing options...
0 Gr8 Posted October 12, 2014 Report Share Posted October 12, 2014 havent tested it but i would assume it would work Link to comment Share on other sites More sharing options...
0 BetterDeadThanZed Posted October 12, 2014 Report Share Posted October 12, 2014 Doesn't seem to work. I coped the vehicle_handleKilled.sqf to my mission file. Added this line to my custom compiles: vehicle_handleKilled = compile preprocessFileLineNumbers "custom\vehicle_loot\vehicle_handleKilled.sqf"; I shot one car up and I also crashed another and in neither case did any loot drop. Link to comment Share on other sites More sharing options...
0 Csus Posted October 12, 2014 Report Share Posted October 12, 2014 It could be 1 of 2 things that are stopping it working. No 1. When a vehicle is destroyed I think it's cargo is cleared right away. No 2. When using getWeaponCargo or getMagazineCargo it returns an array in this format [["weapons","weapons"],[1,4]] So when you use a forEach loop of _wep and _mags it's trying to add ["weapons,"weapons"] and [1,4] to the vehicle as cargo. Link to comment Share on other sites More sharing options...
0 BetterDeadThanZed Posted October 12, 2014 Report Share Posted October 12, 2014 It could be 1 of 2 things that are stopping it working. No 1. When a vehicle is destroyed I think it's cargo is cleared right away. No 2. When using getWeaponCargo or getMagazineCargo it returns an array in this format [["weapons","weapons"],[1,4]] So when you use a forEach loop of _wep and _mags it's trying to add ["weapons,"weapons"] and [1,4] to the vehicle as cargo. So any idea if this is even do-able? Link to comment Share on other sites More sharing options...
0 emwilsh Posted October 12, 2014 Report Share Posted October 12, 2014 Ive tried this like betterdead Shot up, crashed cars, helis, planes and no loot around crash :( Hope someone finds away to sort this manythanks Link to comment Share on other sites More sharing options...
0 Csus Posted October 12, 2014 Report Share Posted October 12, 2014 So any idea if this is even do-able? It'll be doable, but I'm not 100% sure of the way of implementing it. I'll have a little mess around with some ideas and see if I can get something happening. Link to comment Share on other sites More sharing options...
0 BetterDeadThanZed Posted October 12, 2014 Report Share Posted October 12, 2014 It'll be doable, but I'm not 100% sure of the way of implementing it. I'll have a little mess around with some ideas and see if I can get something happening. Ok cool. I know there's lots of talented people here so maybe someone has some input that can help you out. Link to comment Share on other sites More sharing options...
0 Gr8 Posted October 13, 2014 Report Share Posted October 13, 2014 Does anybody know what the code is for putting the extra items on the ground if the gear of a vehicle is full ? I can probably implement that into here. Link to comment Share on other sites More sharing options...
0 calamity Posted October 18, 2014 Author Report Share Posted October 18, 2014 Has anyone got this working yet ?? I have had many server issues I have been trying to fix for the last week so I have not tried anything with this yet.. I currently cant get vehicles to spawn. abit bigger of an issue Link to comment Share on other sites More sharing options...
0 striker Posted December 4, 2014 Report Share Posted December 4, 2014 Here Enjoy :) striker calamity 1 Link to comment Share on other sites More sharing options...
0 Gr8 Posted December 4, 2014 Report Share Posted December 4, 2014 Amazing :) Link to comment Share on other sites More sharing options...
Question
calamity
has anyone seen a script that would move loot from exploded vehicle to scatter around the ground
example....
I'm driving and hit a tree my vehicle explodes, all the loot in its inventory is scattered around the ground .
Link to comment
Share on other sites
13 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now