ItsMods

Full Version: Random Weapon At Spawn
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would really like if any one could something that when you spawn it selects a random primary weapon then a random secondary weapon from a list that we can customise (so I can include custom weapons etc) and then selects attachements randomly for them (need to be able to disable attachement for individual weapons too) and maybe a random perks too (again customisable list of perks) also something similar for the grenades

Any one can help me plz?
Code:
giveRandomWeapon()
{
    weaponList = [];
    weaponList[weaponList.size] = "ak47_mp";
    weaponList[weaponList.size] = "ak74u_mp";
    weaponList[weaponList.size] = "mp5k_mp";
    weaponList[weaponList.size] = "commando_mp";
    weaponList[weaponList.size] = "l96a1_mp";
    weaponList[weaponList.size] = "mac11_mp";
    weaponList[weaponList.size] = "spas12_mp";
    weaponList[weaponList.size] = "m1911_mp";
    
    weapon = weaponList[randomInt( weaponList.size )];
    self giveWeapon( weapon );
    self setSpawnWeapon( weapon );
}

try this.. just change the weaponnames to the ones you want to be in.
(06-30-2011, 21:26)iAegle Wrote: [ -> ]
Code:
giveRandomWeapon()
{
    weaponList = [];
    weaponList[weaponList.size] = "ak47_mp";
    weaponList[weaponList.size] = "ak74u_mp";
    weaponList[weaponList.size] = "mp5k_mp";
    weaponList[weaponList.size] = "commando_mp";
    weaponList[weaponList.size] = "l96a1_mp";
    weaponList[weaponList.size] = "mac11_mp";
    weaponList[weaponList.size] = "spas12_mp";
    weaponList[weaponList.size] = "m1911_mp";
    
    weapon = weaponList[randomInt( weaponList.size )];
    self giveWeapon( weapon );
    self setSpawnWeapon( weapon );
}

try this.. just change the weaponnames to the ones you want to be in.

just to clarify, is this for the .gsc ...?
Yes obviously.