Jump to content
Sign in to follow this  
lawndartleo

[REQUEST] Vending machine for crates

Recommended Posts

I'd like to have an object in my MP scenario that can spawn an ammo crate using an addaction. I've tried using this one (https://forums.bistudio.com/topic/193093-request-ammo-box-spawner/?hl=spawn+ammo) but to this point, no success.

 

  • Walk up to something that has an addAction
  • request crate (B_CargoNet_01_ammo_F, for example)
  • crate spawns near player
  • sleep the script for X amount of time so people can't spam

 

 

Share this post


Link to post
Share on other sites

Added that EXACT text to my initplayerlocal.

Aded an object and gave it the name YOUROBJECT to put any naming issues out of the mix.

No addaction seen... At least testing locally.

What exactly is a GLOBAL OBJECT? Just a map object in the mission, or something more specific?

Share this post


Link to post
Share on other sites

Im confused...

YOUROBJECT addAction ["Spawn Ammobox",{createVehicle ["Box_NATO_Wps_F",position YOUROBJECT, [],10,"NONE"];}];

... works

 

But this....

YOUROBJECT addAction
[
    "Spawn Ammobox",
    {
        createVehicle ["Box_NATO_Wps_F",position YOUROBJECT, [],10,"NONE"];
    }
];

... does not.

 

The difference is I made it all one line.

Share this post


Link to post
Share on other sites

Are you sure? Because the fact that your have to put SQF code in 1 line is consistent with it being executed as SQS, and exec command is exactly what would do it. Also some other thread you linked to was suggesting to add 

this exec "initPlayerLocal.sqf"

 to player init. Are you sure you havent added it and forgot to remove? There is no other reason why initPlayerLocal.sqf would execute as SQS unless you forced it yourself. You also shown some examples when you execute another SQF code as SQS

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  

×