Jump to content
Sign in to follow this  
chaoticgood

Can't get createVehicle to work properly.

Recommended Posts

Hello can anyone tell me why this does not work?

commandFunc =
{
_this addAction["Build HQ",{
							hint "Building HQ";
							sleep 3;
							blueHQ = "Land_BagBunker_Large_F" createVehicle (|#|position _this);
							}];
};

I get: Error position: Type Array, expected object, location.

"_this" is the player

Share this post


Link to post
Share on other sites

Actually, _this is not the player. The second one refers to what is passed to the script by the action, e.g an array containing [caller, target, ID, arguments]

position (_this select 0) should do it.

Share this post


Link to post
Share on other sites

you could also use the 'createVehicle ARRAY' command instead:

blueHQ = createVehicle["Land_BagBunker_Large_F", position (_this select 0), [], 0, "NONE"];

or

blueHQ = createVehicle["Land_BagBunker_Large_F", position (_this select 0), [], 0, "CAN_COLLIDE"];

if you need the object/vehicle at exactly that position.

greetings Na_Palm

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  

×