FlyingTarta 3 Posted April 30, 2019 Hello, i just make a script to call a truck to my position via menu action, and when i test it in SP works perfectly, but when i try it in MP it donest work and i dont understund why ( i even tryed in TASDT) and in both has the same error: Error undefined variable in expresion: chof <- variable which is defined in varinit.sqf. to test the script, just execVM script/sumi.sqf in a vehicle with a driver. https://github.com/Flyingtarta/SupplyiesScript-/tree/master/Supplies Share this post Link to post Share on other sites
Crazy_Man 36 Posted April 30, 2019 It's a problem with initialization order. Try to put a delay to your sumi.sqf script like that : waitUntil {time > 5}; // delay //select the current vehicle _veh = _this select 0; //make the driver as variable _dvr = driver _veh; //we save that variable globally chof = [ chof , _dvr ] call BIS_fnc_arrayPush; //chof pushBack _dvr; //publicVariable chof; _veh setfuel 0; //saves the position of the vehicle. call tarta_fnc_safepos; [ "<t color='#FFFF00'>suministros </t>", //acction in yelow "call tarta_fnc_desplz", //script 1 "<t color='#FF0000'>cancelar suministros </t>", //cancel tthe call (red) "call tarta_fnc_VolverZonaSegura" //script 2 ] call tarta_fnc_addaction; //while the driver is alive, reports its status while { alive _dvr } do { call tarta_fnc_reportesPeligro; }; Share this post Link to post Share on other sites
Hiddens 5 Posted May 1, 2019 hello, try with include #include "Supplies\varinit.sqf"; Share this post Link to post Share on other sites
FlyingTarta 3 Posted May 1, 2019 12 hours ago, Hiddens said: #inclu 16 hours ago, Crazy_Man said: It's a problem with initialization order. Try to put a delay to your sumi.sqf script like that : waitUntil {time > 5}; // delay //select the current vehicle _veh = _this select 0; //make the driver as variable _dvr = driver _veh; //we save that variable globally chof = [ chof , _dvr ] call BIS_fnc_arrayPush; //chof pushBack _dvr; //publicVariable chof; _veh setfuel 0; //saves the position of the vehicle. call tarta_fnc_safepos; [ "<t color='#FFFF00'>suministros </t>", //acction in yelow "call tarta_fnc_desplz", //script 1 "<t color='#FF0000'>cancelar suministros </t>", //cancel tthe call (red) "call tarta_fnc_VolverZonaSegura" //script 2 ] call tarta_fnc_addaction; //while the driver is alive, reports its status while { alive _dvr } do { call tarta_fnc_reportesPeligro; }; it was that!! thank you! Share this post Link to post Share on other sites