Forum Jump :

Author Message


Posts: 4
Rank:


Level: Member

Country: au
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-12-23 04:23        
     
Hey guys, i've been trying to work this out for a while now, and wanted some advice.
How do i add an Init into the object through the .Sqf file?

I already have an Admin Menu that i would like to use to spawn the supply Crate, i just need to make it into an Arsenal Box.

arsenal.sqf:
_spawn = "B_supplyCrate_F";
_posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
_dirplr = getDir player;
_spwnveh = _spawn createVehicle (_posplr);
_spwnveh setVehicleInit "this addAction["Arsenal","ArsenalSpawn.sqf"];";
_spwnveh setVariable ["Sarge",1,true];

ArsenalSpawn.sqf:
["Open",true] spawn BIS_fnc_arsenal;
The Admin Menu works fine. It just gives me an error when i spawn the crate. I think there is an error with the line:
_spwnveh setVehicleInit "this addAction["Arsenal","ArsenalSpawn.sqf"];";
But i can't find the error.

Thanks,
Nuclear


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#2 Posted at 2016-12-23 09:56        
     
SetVehicleInit is disabled for Arma3. (just read the page of the command on BIKI).


_pos = player modelToWorld [0,2,0];
_crate = "B_supplyCrate_F" createVehicle _pos;
_crate addAction["Arsenal",{["Open",true] spawn BIS_fnc_arsenal}];

what else?

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 4
Rank:


Level: Member

Country: au
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2016-12-24 00:02        
     
Thank you Pierre, it works!

Nuclear