Jump to content

[4.0-5.0] Spawn with a random weapon


Recommended Posts

Author Name: Deadlesszombie / Neil Smith

Because i hate myself i made a script that allows people to spawn in with a rifle and 4 magazines, the guns have scopes and silencers as i got it from a bohemia list, enjoy

https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Weapons

Add this literally anywhere

Examples:

fn_civLoadout.sqf

fn_copLoadout.sqf

just make sure it is before the "[] call life_fnc_playerSkins; [] call life_fnc_saveGear;"

//Weapon List
_weaponList = [
    ["srifle_EBR_DMS_pointer_snds_F","20Rnd_762x51_Mag"],
    ["arifle_Katiba_ARCO_pointer_snds_F","30Rnd_65x39_caseless_green_mag_Tracer"],
    ["arifle_MX_SW_Hamr_pointer_F","100Rnd_65x39_caseless_mag_Tracer"],
    ["arifle_MXM_RCO_pointer_snds_F","30Rnd_65x39_caseless_mag_Tracer"],
    ["hgun_PDW2000_Holo_snds_F","30Rnd_9x21_Green_Mag"],
    ["arifle_Mk20_MRCO_pointer_F","30Rnd_556x45_Stanag_Tracer_Yellow"],
    ["SMG_02_ARCO_pointg_F","30Rnd_9x21_Mag_SMG_02_Tracer_Red"]
];
//choose a random weapon
_weapon = _weaponList select floor(random(count _weaponList));
//add said weapon
player addWeapon (_weapon select 0);
//add 4 magazines
player addMagazine (_weapon select 1);
player addMagazine (_weapon select 1);
player addMagazine (_weapon select 1);
player addMagazine (_weapon select 1);

 

  • Like 1
Link to post
Share on other sites
  • 2 years later...
On 10/24/2017 at 6:13 AM, Deadlesszombie said:

Author Name: Deadlesszombie / Neil Smith

Because i hate myself i made a script that allows people to spawn in with a rifle and 4 magazines, the guns have scopes and silencers as i got it from a bohemia list, enjoy

https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Weapons

Add this literally anywhere

Examples:

fn_civLoadout.sqf

fn_copLoadout.sqf

just make sure it is before the "[] call life_fnc_playerSkins; [] call life_fnc_saveGear;"

//Weapon List
_weaponList = [
    ["srifle_EBR_DMS_pointer_snds_F","20Rnd_762x51_Mag"],
    ["arifle_Katiba_ARCO_pointer_snds_F","30Rnd_65x39_caseless_green_mag_Tracer"],
    ["arifle_MX_SW_Hamr_pointer_F","100Rnd_65x39_caseless_mag_Tracer"],
    ["arifle_MXM_RCO_pointer_snds_F","30Rnd_65x39_caseless_mag_Tracer"],
    ["hgun_PDW2000_Holo_snds_F","30Rnd_9x21_Green_Mag"],
    ["arifle_Mk20_MRCO_pointer_F","30Rnd_556x45_Stanag_Tracer_Yellow"],
    ["SMG_02_ARCO_pointg_F","30Rnd_9x21_Mag_SMG_02_Tracer_Red"]
];
//choose a random weapon
_weapon = _weaponList select floor(random(count _weaponList));
//add said weapon
player addWeapon (_weapon select 0);
//add 4 magazines
player addMagazine (_weapon select 1);
player addMagazine (_weapon select 1);
player addMagazine (_weapon select 1);
player addMagazine (_weapon select 1);

 

how can i use this for a random Vitem?

Link to post
Share on other sites
On 12/24/2019 at 7:07 AM, DausLan said:

how can i use this for a random Vitem?

handleInv I would imagine, 

[false,"boltcutter",1] call life_fnc_handleInv;

Here is an example of removing a boltcutter, taken from fn_boltcutter.sqf, to add an item, it would be 'True'

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.