ItsMods

Full Version: Receiving a random primary & secondary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently I'm using a switch to give myself a weapon but it's been really annoying because I can't use a true random weapon generator. So I'm looking to spawn with a primary and secondary using a specific set of weapons. (Do note I did change up isValidAttachments so it returns no attachments at times, which is what I would also need.)
@Yamato told me to check out _class or use level.weaponlist (but the second one returns all weapons).

I was thinking of using tableLookUp or so but I have no idea on how to use such functions.
This is how I did it in MW2
http://pastebin.com/67kLFCnk
Change weapon names and attachment names and it should be the same.
It doesn't give you a random secondary, but you can easily make it so.
Yup I see it, thanks!


Edit: This thread can be locked it's finished Smile
Code:
weap = random(level.weaponlist);

????
(07-22-2013, 04:49)Nukem Wrote: [ -> ]
Code:
weap = random(level.weaponlist);

????

That's all the weapons in the game, I wanted to use a specific set. I was too lazy to actually make more checks for if the weapon was a primary/secondary.
(07-22-2013, 05:10)DidUknowiPwn Wrote: [ -> ]
(07-22-2013, 04:49)Nukem Wrote: [ -> ]
Code:
weap = random(level.weaponlist);

????

That's all the weapons in the game, I wanted to use a specific set. I was too lazy to actually make more checks for if the weapon was a primary/secondary.

But the code might be shorter Cool