Jump to content
Sign in to follow this  
Rektavu

lose weapons spawn on ground / in buildings and stuff

Recommended Posts

I saw that you can now place weapons on the ground lose in the new update.

but how would i be avaible to make weapons spawn randomly around the map? i tried some stuff but it turned out shit :/

please i need help

Share this post


Link to post
Share on other sites

That's asking quite a bit to be able to "spawn random weapons, randomly around the map". I say this because I suspect you want the weapons to spawn in buildings, on tables etc etc... randomly. Dreadentity made a loot spawning framework. Also here's some additional code to get you started with some ideas.

_cfgArray = " (getNumber (_x >> 'scope') >= 2) && {getText (_x >> 'vehicleClass') in ['WeaponsPrimary']}" configClasses (configFile >> "CfgVehicles");

_posArray = [ [5655,5678,12], [5653,5672,10], [5455,5578,6] ];
_weaponArray = [];

{
_weaponArray pushBack ( configname _x );
} forEach _cfgArray;

_randomWeapon = _weaponArray call BIS_fnc_selectRandom; 
_randomPos = _posArray call BIS_fnc_selectRandom;
_groundWeapon = createVehicle [_randomWeapon, _randomPos, [], 0, "CAN_COLLIDE"];

Share this post


Link to post
Share on other sites

You could possibly achieve what you are looking for with this code snippet, you may have to make some alterations, but it seems to be what you want..?

Share this post


Link to post
Share on other sites

Yeah he'd be better off using Dread's loot spawning framework. He's lucky Dread had just posted that. Coming and asking "Hey write me a loot spawning system" is a bit much haha.

Share this post


Link to post
Share on other sites

thanks everyone (and yea i was kind of lazy) im not that good at scripting i dont even know the full basics and im trying to lern more and more everyday and hopefully one day i can make a mission without asking for help :p Thanks anyway :D

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  

×