Jump to content
Sign in to follow this  
_qor

createUnit - unit pops up shortly

Recommended Posts

Hey there,

I want to create a vehicle with crew inside.

simple thing:

GrpM2 = createGroup West;

vehicle = GrpM2 createUnit ["M2A2_EP1", getMarkerPos "heavyDefSB1", [], 0, "NONE"];

but when executing this, the vehicle pops up and disappears straight.

why?

Share this post


Link to post
Share on other sites

This code spawn vehicle with crew inside it.

- create a marker "heavyDefSB1"

- put a west side unit somewhere in map

_gaurd = [getMarkerPos "heavyDefSB1", 270, "M2A2_EP1", West] call BIS_fnc_spawnVehicle;

read more: - BIS_fnc_spawnVehicle

this code spawn random vehicle with crew inside it.

// Select random a vehicle from list "classnames"
_vehicle = [
"LandRover_MG_TK_INS_EP1","LandRover_SPG9_TK_INS_EP1","BRDM2_TK_EP1","T34_TK_EP1","T55_TK_EP1","M113_TK_EP1",
"Offroad_DSHKM_INS","Pickup_PK_INS","UAZ_AGS30_TK_EP1","T72_TK_EP1"
] call BIS_fnc_selectRandom;
// select where to spawn
_ran_post = getmarkerpos "heavyDefSB1";	
// create a invisible H empty at pos
_position = "HeliHEmpty" createVehicle (_ran_post); 
// Spawn vehicle with crew inside it 
_veh_patrol = [(getpos _position), (getdir _position), (_vehicle), east] call BIS_fnc_spawnVehicle;
// give name to ur vehicle
vehicle_1 = _veh_patrol select 0;
// Execute a script in the vehicle init
//ran_veh_ups setVehicleInit "nul = [this, 'area1','nofollow','onroad','delete:',500] execVM 'scripts\upsmon.sqf'";
//processInitCommands;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×