Jump to content
Mr H.

Deleting a backpack created via script bug?

Recommended Posts

Hi,

when I create a backpack (left on the ground)  through a script, the packpack is deleted but the object's model remains visible. If I pick the model again, it disappears (and is not visible in my backback inventory slot). Am I doing it wrong or is this a known issue? here's a small test script to illustrate the issue.
 

////test.sqf
_bag = "B_Carryall_oli" createVehicle (player modelToWorld [0,1,0]);
sleep 3;
deleteVehicle _bag;
hint "deleted";

 

Share this post


Link to post
Share on other sites

Yes, it's a weird behavior due to Arma's engine. When you create a backpack as vehicle, you create a weapon holder in which the backpack is. So you can't definitely delete the backpack with the same variable, but the weapon holder as "container" of this backpack.

 

Two ways to proceed:

0 = []spawn {

  _bag = "B_Carryall_oli" createVehicle (player modelToWorld [0,1,0]);
  sleep 3;
  deleteVehicle objectParent _bag;
  hint "deleted";

;

or:

0 = []spawn {

  _bagContainr = "groundWeaponHolder" createVehicle (player modelToWorld [0,1,0]);
  _bagContainr addBackpackCargo ["B_Carryall_oli",1];
  sleep 3;
  deleteVehicle _bagContainr;
  hint "deleted";

};

  • Like 1

Share this post


Link to post
Share on other sites

perfect I'll try that very soon thanks dude!

Share this post


Link to post
Share on other sites

works like a charm!

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

×