• 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?
[-] The following 1 user says Thank You to Scripts18 for this post:
  • Bandarigoda123
  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

[-] The following 3 users say Thank You to iAegle for this post:
  • Bandarigoda123, Brandeeno, GoldenWrapper
  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]
[-] The following 1 user says Thank You to DidUknowiPwn for this post:
  • Bandarigoda123
  Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)