Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Random Weapon At Spawn
#1
Exclamation 
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?
Reply

#2
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.
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#3
(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 ...?
Reply

#4
Yes obviously.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 4,134 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,733 11-08-2013, 05:25
Last Post: [HARD] Tony.
Question Help Mw2 weapon skin question FroxIVx4 1 2,964 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,629 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 4,762 09-15-2013, 16:43
Last Post: DidUknowiPwn
  Help choose 2 random players?(1 each team) 26hz 6 4,688 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,478 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Help Receiving a random primary & secondary DidUknowiPwn 5 4,436 07-22-2013, 09:47
Last Post: Yamato
  Help Spawn Message Playing on Respawn? Killjoy 7 5,284 07-11-2013, 14:53
Last Post: Killjoy
  Help Mw2 weapon skin question FroxIVx4 1 2,934 07-06-2013, 19:22
Last Post: surtek

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.