miguel93041 0 Posted August 1, 2016 Hello all. Im having a problem with a config of my vehicle... Im trying to make a siren script but i dont know why im getting this error and i cant never spawn the say command. Im trying different methods to resolve this but no one works. I let you the code here in the config.cpp of the vehicle i have the EH calling the Init. class EventHandlers: EventHandlers { init = "_this execVM '\slm_s60Arma\scripts\init.sqf';"; }; And the action class LED { displayName = "<t color='#a40000'>LED ON</t>"; position = "lightbar_axis"; radius = 10; condition = "driver this == player && (this animationPhase 'ani_lightbar' != 0.5)"; statement = "this animate ['ani_lightbar', 0.5]"; onlyForplayer = 1; }; The init _car = _this select 0; _car execVM "\slm_s60Arma\scripts\Lightbar.sqf"; _car execVM "\slm_s60Arma\scripts\directional.sqf"; _car execVM "\slm_s60Arma\scripts\sirens.sqf"; TIP: Here the _this select 0 its working. i saw the array of an EH with animations and the _this select 0 is meaning the object/unit but its not working in the sirens. sirens.sqf private ["_car"]; _car = _this select 0; while {alive _car} do { waitUntil {_car animationPhase "ani_Sirens" >= 0.5}; _car say "sirena1"; sleep 0.6; }; The error is in the line 2. Because of the _this select 0; Share this post Link to post Share on other sites
Nathan423 10 Posted August 1, 2016 For the init, change _car = _this select 0; _car execVM "\slm_s60Arma\scripts\Lightbar.sqf"; _car execVM "\slm_s60Arma\scripts\directional.sqf"; _car execVM "\slm_s60Arma\scripts\sirens.sqf"; to _car = _this select 0; [_car] execVM "\slm_s60Arma\scripts\Lightbar.sqf"; [_car] execVM "\slm_s60Arma\scripts\directional.sqf"; [_car] execVM "\slm_s60Arma\scripts\sirens.sqf"; As sirens.sqf is using this select 0, which requires an array. This is because you are pulling the object out of the array, so you have to put it back into an array. Alternativly, you can change your sirens.sqf to _car = _this; or (untested) params ["_car"]; Share this post Link to post Share on other sites
miguel93041 0 Posted August 7, 2016 It worked thank you. :D Share this post Link to post Share on other sites
By-Jokese 3 Posted September 28, 2016 Sorry for posting here, but arma does not allow me to post out. I have same problem, could any help me? I have this on my config.cpp class my_class: object_class { //this is correct scope = 2; accuracy = 10000; armor = 5000; displayName = "the_name"; model = "\pbo\to\the\object.p3d"; class EventHandlers { init = "(_this select 0) execVM ""\pbo\to\the\virtual_arsenal_init.sqf""" }; }; An on the virtual_arsenal_init.sqf file: //Init stuff _crate = _this select 0; ["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal; //Lists of items to include _availableHeadgear = [ "H_HelmetB", "H_HelmetCrew_B" ]; _availableGoggles = [ "G_Combat", "G_Bandanna_blk" ]; _availableUniforms = [ "U_B_CombatUniform_mcam", "U_B_CTRG_3" ]; _availableVests = [ "V_BandollierB_khk", "V_PlateCarrierH_CTRG" ]; _availableBackpacks = [ "B_AssaultPack_rgr", "B_TacticalPack_mcamo" ]; //Populate with predefined items and whatever is already in the crate [_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo; [_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests)] call BIS_fnc_addVirtualItemCargo; [_crate,(magazineCargo _crate)] call BIS_fnc_addVirtualMagazineCargo; [_crate,(weaponCargo _crate)] call BIS_fnc_addVirtualWeaponCargo; Its says Select Error. Any idea. I want to add custom VA to a object done by me. Share this post Link to post Share on other sites