I have this bit of code which will load objects into vehicles using r3f logistics.
I'm having trouble as it runs once for every player so instead of placing 24 fuel cans, it places 48 when two players, 72 when three players etc. Anyone know how to make it run only once on the server and not for each player?
startpreload.sqf
preload.sqfCode:[fuelcontainer1, [fuel1,fuel2,fuel3,fuel4,fuel5,fuel6,fuel7,fuel8,fuel9,fuel10,fuel11,fuel12,fuel13,fuel14,fuel15,fuel16,fuel17,fuel18,fuel19,fuel20,fuel21,fuel22,fuel23,fuel24]] execVM "preload.sqf";
Code:// LOG module needs to be running for this to work waitUntil {!isNil "R3F_LOG_PUBVAR_point_attache"}; private ["_objectArray", "_vehicle", "_currentItems"]; // Parameters _vehicle = _this select 0; _objectArray = _this select 1; // Add items to the vehicle _currentItems = []; _currentItems = _vehicle getVariable "R3F_LOG_objets_charges"; if (isNil "_currentItems") then {_currentItems = []}; _currentItems = _currentItems + _objectArray; _vehicle setVariable ["R3F_LOG_objets_charges", _currentItems, true]; // This block of code comes from R3F_ARTY_AND_LOG\R3F_LOG\transporteur\charger_deplace.sqf // Absolutely all credit goes to R3F and madbull { private ["_position_attache", "_nb_tirage_pos"]; _position_attache = [random 3000, random 3000, (10000 + (random 3000))]; _nb_tirage_pos = 1; while {(!isNull (nearestObject _position_attache)) && (_nb_tirage_pos < 25)} do { _position_attache = [random 3000, random 3000, (10000 + (random 3000))]; _nb_tirage_pos = _nb_tirage_pos + 1; }; _x attachTo [R3F_LOG_PUBVAR_point_attache, _position_attache]; } forEach _objectArray;
HOME 
Reply With Quote





